Skip to content

fix: reject substituted ASN.1 certificate tags#51

Open
leopoldjoy wants to merge 1 commit into
mainfrom
security/strict-cert-asn1-tags
Open

fix: reject substituted ASN.1 certificate tags#51
leopoldjoy wants to merge 1 commit into
mainfrom
security/strict-cert-asn1-tags

Conversation

@leopoldjoy

Copy link
Copy Markdown
Contributor

Summary

  • require exact expected ASN.1 tags at key X.509 certificate parsing boundaries
  • reject constructed tag substitutions that previously could be traversed as long as their child layout matched
  • add regressions for outer certificate and TBS AlgorithmIdentifier tag substitution

Security value

This reduces parser disagreement with strict X.509/DER tooling by rejecting non-certificate constructed objects instead of interpreting them as valid certificate containers.

Tests

  • forge fmt --check src test
  • forge test --match-test 'test_VerifyCACertWithHints_Rejects.*TagSubstitution' -vvv

Note

Latest main already fails test_DeployableContractsFitEIP170 locally with CertManager runtime bytes 24,708 > 24,576, so full-suite verification remains blocked by that pre-existing size issue.

Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
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