Skip to content

Enforce maxNameLength incrementally in ReaderBasedJsonParser [GHSA-649p-m576-vr99] - #1643

Merged
cowtowncoder merged 5 commits into
FasterXML:2.18from
tinyb0y:fix-GHSA-649p-m576-vr99
Jul 29, 2026
Merged

Enforce maxNameLength incrementally in ReaderBasedJsonParser [GHSA-649p-m576-vr99]#1643
cowtowncoder merged 5 commits into
FasterXML:2.18from
tinyb0y:fix-GHSA-649p-m576-vr99

Conversation

@tinyb0y

@tinyb0y tinyb0y commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes GHSA-649p-m576-vr99.

ReaderBasedJsonParser._parseName2() only validated accumulated
property-name length against maxStringLength while buffering, and
against maxNameLength once at the very end (via findSymbol).
Reader/String/char[] input could therefore buffer a property name up
to maxStringLength before maxNameLength ever fired, unlike
byte-based input, which already validates incrementally via
ParserBase._growNameDecodeBuffer().

This tracks accumulated length locally in _parseName2() and
validates on each buffer-segment fill, matching the existing
byte-parser idiom (same pattern as #1611 for the analogous
maxNumberLength async-parser gap).

Tests

  • New LargeNameReadTest.largeNameWithSmallLimitCharsFailsFast pins
    the fix: fails on unpatched code (reports the full buffered length),
    passes on patched code (rejects within one buffer-segment fill).
  • Full mvn test: 1441 tests run, 0 failures, 0 errors, 2 skipped
    (pre-existing).

@cowtowncoder cowtowncoder changed the title Enforce maxNameLength incrementally in ReaderBasedJsonParser (GHSA-649p-m576-vr99) Enforce maxNameLength incrementally in ReaderBasedJsonParser [GHSA-649p-m576-vr99] Jul 29, 2026
@cowtowncoder cowtowncoder added processing-limits Issues related to limiting aspects of input/output that can be processed without exception 2.18 Issues planned at earliest for 2.18 cla-needed PR looks good (although may also require code review), but CLA needed from submitter labels Jul 29, 2026
@cowtowncoder

Copy link
Copy Markdown
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 cla at fasterxml dot com.
Only needed once; once we have it can merge any and all PRs.

Looking forward to merging!

@tinyb0y

tinyb0y commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@cowtowncoder I've shared the signed CLA via email.

@cowtowncoder cowtowncoder added cla-received PR already covered by CLA (optional label) and removed cla-needed PR looks good (although may also require code review), but CLA needed from submitter labels Jul 29, 2026
@cowtowncoder

Copy link
Copy Markdown
Member

Wow that was fast, @tinyb0y ! Thank you.

@cowtowncoder
cowtowncoder merged commit 2cd206d into FasterXML:2.18 Jul 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.18 Issues planned at earliest for 2.18 cla-received PR already covered by CLA (optional label) processing-limits Issues related to limiting aspects of input/output that can be processed without exception

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants