Repository navigation
Reject nonempty DigestAlgorithm NULL parameters - #1157
Open
itsalexfer wants to merge 2 commits into
Open
itsalexfer wants to merge 2 commits into
itsalexfer wants to merge 2 commits into
Conversation
Require DigestAlgorithm SEQUENCE element count (OID + optional NULL) so asn1.validate cannot ignore interior padding that bypasses CVE-2026-33894. Co-authored-by: Cursor <cursoragent@cursor.com>
Supplement the nested element-count fix with strict NULL contents validation and compatibility tests.
Open
4 tasks
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.
Builds on #1152, with credit to @Krysthyan for its nested DigestAlgorithm element-count fix and @geo-chen for the original report.
This supplement also rejects primitive ASN.1 NULL parameters containing bytes, which must have empty contents. The new synthetic private-key fixtures demonstrate malformed-encoding acceptance, not forgery without a private key. Compatibility tests retain absent and empty NULL parameters, legacy BER verification, PSS, NONE, and native-generated signatures.
Tests: Node 24.14.1 with pinned upstream Mocha 5.2.0: 837 passing, 4 pending; RSA subset: 109 passing, 4 pending. Focused prior-code checks: 8 passing/1 expected failure; patched: 9 passing. Existing lint errors remain; the borrowed regression adds one unused-variable warning.
AI disclosure: Supplemental tests were generated by an AI agent using GPT-6 Astra (Max reasoning). The NULL guard already existed in our local Lerix mitigation. We are contributing it to support eventual adoption of an official release.