Skip to content

Bump jackson_version - Fix GHSA-72hv-8253-57qq #37969

Open
stankiewicz wants to merge 2 commits intoapache:masterfrom
stankiewicz:patch-7
Open

Bump jackson_version - Fix GHSA-72hv-8253-57qq #37969
stankiewicz wants to merge 2 commits intoapache:masterfrom
stankiewicz:patch-7

Conversation

@stankiewicz
Copy link
Copy Markdown
Contributor

GHSA-72hv-8253-57qq
jackson-core: Number Length Constraint Bypass in Async Parser Leads to Potential DoS Condition


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

jackson-core: Number Length Constraint Bypass in Async Parser Leads to Potential DoS Condition
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 necessary security update by bumping the Jackson library version. This change mitigates a known vulnerability that could be exploited to cause a Denial of Service, ensuring the stability and security of the project's dependencies.

Highlights

  • Security Vulnerability Mitigation: Updated the Jackson library version to 2.18.6 to address the security vulnerability GHSA-72hv-8253-57qq, which relates to a potential Denial of Service condition in the Async Parser.
  • Dependency Management: Synchronized the Jackson BOM version in the dependency configuration files to ensure consistency across the project.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @kennknowles for label java.
R: @liferoad for label build.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn
Copy link
Copy Markdown
Contributor

Abacn commented Mar 26, 2026

In the past there were security fixes caused regressions: #26743. From 2.15 to 2.18 there are several more:

Gemini said

1. Expansion of "Processing Limits" (2.16 & 2.18)
Building on the string/nesting limits introduced in 2.15, 2.16 and 2.18 added new constraints. If your JSON exceeds these, you will now get a StreamConstraintsException.

Max Property Name Length (2.16): Limits the length of JSON keys (Object property names). The default is 50,000 characters.

Max Token Count (2.18): A new limit on the total number of tokens (e.g., {, }, "key", true) allowed in a single document. This is designed to stop "low-bandwidth DoS" where a small file (like [[[[...]]]]) consumes massive memory during tree building.

Note: It is currently unlimited by default, but many security-hardened configurations now suggest setting a limit.

Output Nesting Limit (2.16): Jackson now limits how deep your Java objects can be nested when writing JSON (default 1,000 levels).

2. Security: Redacted Source Locations (2.16)
In 2.15, if a parsing error occurred, the exception message often included a snippet of the source JSON.

The Change: Starting in 2.16, StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION is set to false by default.

The Impact: Your error logs will no longer show the actual JSON snippet causing the error; it will simply say REDACTED. This is to prevent sensitive data (PII/passwords) from leaking into logs.

How to revert:

Java
JsonFactory factory = JsonFactory.builder()
    .enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)
    .build();
3. Major Rewrite: Property Introspection (2.18)
Version 2.18 includes a massive internal rewrite of how Jackson "looks" at your classes to find getters, setters, and constructors.

The Goal: Unify the logic for POJOs, Records, and Kotlin data classes.

Potential "Break": While mostly compatible, if you relied on very specific, undocumented behavior regarding how @JsonCreator interacted with implicit parameter names or "annotation-less" constructors, you might see changes in which constructor Jackson picks by default.

Better Record Support: This rewrite finally fixes several long-standing bugs where @JsonAnySetter wouldn't work correctly with Java Records.

is there potential concern for these listed changes and/or there are others

@stankiewicz
Copy link
Copy Markdown
Contributor Author

well, it may break user code at edge cases - very long property names, very large jsons with plenty of tokens per element, nested. Most scary is is about different constructor picked up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants