jackson-core: UTF8DataInputJsonParser._reportInvalidToken() does not honor maxErrorTokenLength, allowing unbounded StringBuilder growth
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 2.21.7, 2.22.3, 3.1.7, 3.2.3, 2.18.11
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: poc
- Automatable: yes
- Technical impact: partial
Summary
UTF8DataInputJsonParser._reportInvalidToken() in FasterXML jackson-core builds the offending-token text for its error message by appending Java identifier characters to a StringBuilder in a loop that has no upper bound. Unlike the three sibling parser implementations, including UTF8StreamJsonParser, it never consults ErrorReportConfiguration.getMaxErrorTokenLength() (default 256). A malformed token supplied to a parser created through JsonFactory.createParser(DataInput) is therefore accumulated in full. No StreamReadConstraints setting mitigates this: maxDocumentLength cannot be applied to DataInput sources at all, and maxStringLength does not cover this path because the accumulation bypasses ReadConstrainedTextBuffer. The reporter measured a 20,000,109-character exception message from a 20-million-character malformed token on the DataInput path, against 367 characters for identical input on the InputStream path. Scaling the payload drives the StringBuilder, which also incurs byte-to-char expansion and internal array doubling, to many times the raw payload size and can trigger OutOfMemoryError for the whole JVM. UTF8DataInputJsonParser was introduced in 2.8.0 together with createParser(DataInput); releases before 2.8.0 do not contain the affected class.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: poc · Automatable: yes · Technical impact: partial
- Record last updated
Affected versions
- com.fasterxml.jackson.core:jackson-core
From 2.8.0 · through 2.18.10; From 2.19.0 · through 2.21.6; From 2.22.0 · through 2.22.2
- tools.jackson.core:jackson-core
From 3.0.0 · through 3.1.6; From 3.2.0 · through 3.2.2
- com.fasterxml.jackson.core:jackson-coreMaven
From 2.19.0 · fixed in 2.21.7
- com.fasterxml.jackson.core:jackson-coreMaven
From 2.22.0 · fixed in 2.22.3
- tools.jackson.core:jackson-coreMaven
From 3.0.0 · fixed in 3.1.7
- tools.jackson.core:jackson-coreMaven
From 3.2.0 · fixed in 3.2.3
- com.fasterxml.jackson.core:jackson-coreMaven
From 2.8.0 · fixed in 2.18.11