Skip to content

chore(deps): bump node-forge to 1.4.2 - #587

Merged
koral-- merged 1 commit into
masterfrom
fix/node-forge-1.4.2
Nov 7, 2026
Merged

koral-- merged 1 commit into
masterfrom
fix/node-forge-1.4.2

Conversation

@koral--

@koral-- koral-- commented Nov 7, 2026

Copy link
Copy Markdown
Member

Supersedes #578 (Dependabot's node-forge 1.4.0 → 1.4.2), which fails CI.

node-forge 1.4.2 throws on a PKCS#1 v1.5 signature with garbage in its DigestInfo (GHSA-86w9-cpqp-85rv). Version 1.4.0 accepted it. The TcpUsb test "should not accept garbage in the DigestInfo from a known key" called forge's verify() to check that its forged signature would fool a lax verifier. On 1.4.2 that call throws, so the test failed.

adbkit's code doesn't change. The TcpUsb bridge checks AUTH signatures with OpenSSL in verifies() (since #570), not with node-forge. node-forge is still used to parse keys and for the adbkit CLI.

Changes

  • node-forge is locked at 1.4.2, the version Dependabot proposed, and the range goes from ^1.4.0 to ^1.4.2 so consumers get the fixed version as well. 1.4.3 came out 3 days ago, so I left it for Dependabot.
  • The test now checks the forged signature with OpenSSL (crypto.publicDecrypt with PKCS#1 padding): the padding is valid and ends in the token, and only the DigestInfo has garbage in it. This doesn't depend on the node-forge version.

Testing

  • 284 tests pass and lint is clean.
  • As a check, I weakened verifies() so it only compares the trailing token. Both garbage-DigestInfo tests then fail; with the real verifies() they pass.

🤖 Generated with Claude Code

node-forge 1.4.2 throws on a PKCS#1 v1.5 signature with garbage in its
DigestInfo, where 1.4.0 accepted it (GHSA-86w9-cpqp-85rv). One TcpUsb
test used forge's verify() to show that its forged signature fools a lax
verifier, so it failed on 1.4.2 (Dependabot's #578).

adbkit itself checks AUTH signatures with OpenSSL, not node-forge, so
nothing outside the test changes. The test now checks the signature with
OpenSSL instead: the padding is valid and ends in the token, and only the
DigestInfo has garbage in it.

Raise the range to ^1.4.2 so consumers get the fixed node-forge too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Karol Wrótniak <karol.wrotniak@droidsonroids.pl>
@koral--
koral-- merged commit ffaeee8 into master Nov 7, 2026
6 checks passed
@koral--
koral-- deleted the fix/node-forge-1.4.2 branch November 7, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant