Update dependency com.fasterxml.jackson.core:jackson-core to v2.18.6 [SECURITY]#263
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Update dependency com.fasterxml.jackson.core:jackson-core to v2.18.6 [SECURITY]#263renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
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.
This PR contains the following updates:
2.18.1→2.18.6GitHub Vulnerability Alerts
GHSA-72hv-8253-57qq
Summary
The non-blocking (async) JSON parser in
jackson-corebypasses themaxNumberLengthconstraint (default: 1000 characters) defined inStreamReadConstraints. This allows an attacker to send JSON with arbitrarily long numbers through the async parser API, leading to excessive memory allocation and potential CPU exhaustion, resulting in a Denial of Service (DoS).The standard synchronous parser correctly enforces this limit, but the async parser fails to do so, creating an inconsistent enforcement policy.
Details
The root cause is that the async parsing path in
NonBlockingUtf8JsonParserBase(and related classes) does not call the methods responsible for number length validation._finishNumberIntegralPart) accumulate digits into theTextBufferwithout any length checks._valueComplete(), which finalizes the token but does not callresetInt()orresetFloat().resetInt()/resetFloat()methods inParserBaseare where thevalidateIntegerLength()andvalidateFPLength()checks are performed.maxNumberLengthconstraint is never enforced in the async code path.PoC
The following JUnit 5 test demonstrates the vulnerability. It shows that the async parser accepts a 5,000-digit number, whereas the limit should be 1,000.
Impact
A malicious actor can send a JSON document with an arbitrarily long number to an application using the async parser (e.g., in a Spring WebFlux or other reactive application). This can cause:
TextBufferto store the number's digits, leading to anOutOfMemoryError.getBigIntegerValue()orgetDecimalValue(), the JVM can be tied up in O(n^2)BigIntegerparsing operations, leading to a CPU-based DoS.Suggested Remediation
The async parsing path should be updated to respect the
maxNumberLengthconstraint. The simplest fix appears to ensure that_valueComplete()or a similar method in the async path calls the appropriate validation methods (resetInt()orresetFloat()) already present inParserBase, mirroring the behavior of the synchronous parsers.NOTE: This research was performed in collaboration with rohan-repos
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.