Enforce maxNameLength incrementally in ReaderBasedJsonParser [GHSA-649p-m576-vr99] - #1643
Merged
Merged
Conversation
Member
|
@tinyb0y Sounds good, I will review. One last (?) thing, if not done already (apologies if I missed it, if so just LMK): we need CLA: https://github.com/FasterXML/jackson/blob/main/CLA-jackson-2026.pdf which is usually done by printing, filling/signing, scan/photo, email to Looking forward to merging! |
Contributor
Author
|
@cowtowncoder I've shared the signed CLA via email. |
Member
|
Wow that was fast, @tinyb0y ! Thank you. |
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.
Fixes GHSA-649p-m576-vr99.
ReaderBasedJsonParser._parseName2()only validated accumulatedproperty-name length against
maxStringLengthwhile buffering, andagainst
maxNameLengthonce at the very end (viafindSymbol).Reader/String/char[] input could therefore buffer a property name up
to
maxStringLengthbeforemaxNameLengthever fired, unlikebyte-based input, which already validates incrementally via
ParserBase._growNameDecodeBuffer().This tracks accumulated length locally in
_parseName2()andvalidates on each buffer-segment fill, matching the existing
byte-parser idiom (same pattern as #1611 for the analogous
maxNumberLengthasync-parser gap).Tests
LargeNameReadTest.largeNameWithSmallLimitCharsFailsFastpinsthe fix: fails on unpatched code (reports the full buffered length),
passes on patched code (rejects within one buffer-segment fill).
mvn test: 1441 tests run, 0 failures, 0 errors, 2 skipped(pre-existing).