Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1161 +/- ##
==========================================
+ Coverage 80.25% 80.27% +0.02%
==========================================
Files 42 42
Lines 9597 9597
==========================================
+ Hits 7702 7704 +2
+ Misses 1895 1893 -2
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
4 tasks done
davidlehn
added a commit
that referenced
this pull request
Oct 27, 2026
- [rsa] Require a canonical DER DigestInfo in RSASSA PKCS#1 v1.5 signature verification by re-encoding the expected DigestInfo and comparing bytes, as in RFC 8017 8.2.2. Rejects extra DigestAlgorithm elements, NULL parameters with content, non-minimal lengths, and non-canonical OIDs. - Address GHSA-2g46-22mc-6gwp (CVE-2026-85393): - GHSA-2g46-22mc-6gwp - Address GHSA-6qrw-m8cv-hcxf: - GHSA-6qrw-m8cv-hcxf - Based on work in PRs #1159 (@matthewscottconroy), #1160 (@shaswata56), #1161 (@nitrog7), and #1162 (@RoastFried-RF). - Add PoC from PR #1160. - Add tests for canonical and non-canonical DigestInfo encodings, and for every supported digest algorithm with and without NULL parameters. Co-authored-by: Matthew Conroy <matthew.conroy@ibm.com> Co-authored-by: Shaswata Das <shaswata56@gmail.com>
Member
|
Thank you. Your test ideas, including the per-hash and MD5 NULL parameter cases, are in node-forge 1.4.1's tests, and you're credited in GHSA-2g46-22mc-6gwp. The fix uses canonical re-encoding rather than element checks, so this PR isn't merged. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RSA PKCS#1 v1.5 verification accepts unconsumed fields inside the nested
DigestAlgorithmsequence. Enforce its exact OID/optional-NULL element count and require a present NULL value to be empty. This closes the documented nested-element bypass and prevents garbage being carried inside the NULL itself.References: CVE-2026-85393 / GHSA-86w9-cpqp-85rv, #1149, and the element-count proposal in #1152. The additional empty-NULL check matters: applying only #1152's count check still accepts the new nonempty-NULL regression. Existing SHA parameter-omission acceptance and the MD5 requirement for NULL parameters are preserved. No RSA arithmetic or padding algorithm changes.
The 14 new regression/compatibility tests sign deliberately structured DigestInfo values with an existing fixture private key and verify using the normal public verifier, including normal padding and trailing-byte checks. They demonstrate the verification parser gap; they do not claim to generate a signature forgery without the private key.
Validation on Node 24.15.0 / macOS:
npm run test-node -- --forbid-only: 842 passing, 4 pending.mocha -t 30000 tests/unit/rsa.js --forbid-only: 114 passing, 4 pending.The four pending RSA tests are pre-existing. Browser testing and the full upstream Node-version matrix were not run. Package metadata and licensing are unchanged.