Skip to content

fix off-by-4 header length guard in NotationData.verifyData - #2346

Closed
rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:notationdata-header-length-guard
Closed

fix off-by-4 header length guard in NotationData.verifyData#2346
rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:notationdata-header-length-guard

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

NotationData.verifyData counts only nameLength + valueLength + 4 against the body length while its own header is 8 octets (flags[4] || nameLength[2] || valueLength[2]), so a crafted critical notation subpacket that declares more name/value data than the body carries slips past the guard and then throws ArrayIndexOutOfBoundsException from getNotationName()/getNotationValueBytes() on the signature-verify path instead of a clean rejection; counting the full header rejects the short body at parse and completes the sibling Features/TrustSignature/SignatureTarget/RevocationKey/RevocationReason truncation guards; spotted while fuzzing the signature-subpacket parser.

@dghgit

dghgit commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the patch. Merged!

@dghgit dghgit closed this Jul 8, 2026
hubot pushed a commit that referenced this pull request Jul 9, 2026
… OpenPGP notation subpacket header is 8 octets, so a body declaring more name/value than it carried passed the check and overran in getNotationName/getNotationValueBytes; now counts the full header, relates to github #2346.
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.

2 participants