fix(deps): update dependency com.fasterxml.jackson.core:jackson-core to v2.18.6 [security]#10240
Conversation
…to v2.18.6 [security]
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request performs a crucial dependency upgrade for Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the com.fasterxml.jackson.core:jackson-core dependency to version 2.18.6 to remediate a security vulnerability (GHSA-72hv-8253-57qq). The version update in iap/pom.xml is correct. On a related note, the parent POM com.google.cloud.samples:shared-configuration is at version 1.2.0. Per repository guidelines, this should be kept up-to-date. Please consider creating a separate PR to update it to the latest version.
This PR contains the following updates:
2.16.1→2.18.6Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub 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: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.