Skip to content

reject short sequence in cms content-type parsers - #2469

Open
rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:cms-content-type-sequence-size
Open

rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:cms-content-type-sequence-size

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

the cms content-type decoders SignedData, EnvelopedData, AuthenticatedData, AuthEnvelopedData and EncryptedData read their mandatory fields with no lower-bound size check, so a ContentInfo whose inner content is an empty or too-short SEQUENCE leaks a NoSuchElementException/ArrayIndexOutOfBoundsException out of the throws CMSException contract of CMSSignedData(byte[]) and its siblings (the IllegalArgumentException CMSEncryptedData documents) — found auditing the CMS parse entry points; each now rejects a short sequence up front like CompressedData/DigestedData already do, covering the interspersed case where a leading OPTIONAL is claimed and the mandatory fields are then truncated.

AI tooling was used to help prepare this change.

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