Every CVESearch/Get API key

CVE-2026-59171

JSON-java: JSONTokener Unbounded Numeric String Resource-Exhaustion DoS

5.9 MediumFix available

JSON-java is a reference implementation of a JSON package in Java. From version 20150729 through 20260522, JSONTokener.nextSimpleValue can accumulate unbounded numeric tokens before JSONObject.stringToNumber passes them to BigInteger or BigDecimal conversion without a length limit. An application that parses attacker-controlled JSON or XML through JSONObject, JSONArray, or XML.toJSONObject can spend super-linear CPU time converting a sufficiently long numeric literal, blocking request-handling threads and causing denial of service. Strict mode and keep-strings settings in JSONParserConfiguration do not prevent the affected conversion path. Version 20260719 limits numeric conversion length.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.55%Unchanged since Nov 7, 2026
90%50%10%1%

What each source reports

CVE List Score used5.9

JSON-java: JSONTokener Unbounded Numeric String Resource-Exhaustion DoS

JSON-java is a reference implementation of a JSON package in Java. From version 20150729 through 20260522, JSONTokener.nextSimpleValue can accumulate unbounded numeric tokens before JSONObject.stringToNumber passes them to BigInteger or BigDecimal conversion without a length limit. An application that parses attacker-controlled JSON or XML through JSONObject, JSONArray, or XML.toJSONObject can spend super-linear CPU time converting a sufficiently long numeric literal, blocking request-handling threads and causing denial of service. Strict mode and keep-strings settings in JSONParserConfiguration do not prevent the affected conversion path. Version 20260719 limits numeric conversion length.

Record
CVE-2026-59171
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-770
Updated
2026-11-11
EUVDEUVD-2026-1184875.9

JSON-java is a reference implementation of a JSON package in Java. From version 20150729 through 20260522, JSONTokener.nextSimpleValue can accumulate unbounded numeric tokens before JSONObject.stringToNumber passes them to BigInteger or BigDecimal conversion without a length limit. An application that parses attacker-controlled JSON or XML through JSONObject, JSONArray, or XML.toJSONObject can spend super-linear CPU time converting a sufficiently long numeric literal, blocking request-handling threads and causing denial of service. Strict mode and keep-strings settings in JSONParserConfiguration do not prevent the affected conversion path. Version 20260719 limits numeric conversion length.

Record
EUVD-2026-118487
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-11
GitHub AdvisoriesGHSA-ghc9-756g-vrcv5.9

JSON-java: JSONTokener Has Unbounded Numeric String Resource-Exhaustion DoS

1. Executive Summary

JSON-java version 20260522 contains an unguarded path from an HTTP request body to unbounded BigInteger and BigDecimal construction. JSONTokener.nextSimpleValue() accumulates numeric characters into a StringBuilder with no length cap, then passes the full string to JSONObject.stringToNumber(), which calls new BigInteger(val) or new BigDecimal(val) directly. Both constructors have polynomial time complexity (O(n^1.585) for BigInteger).

A 488 KB JSON body — well within nginx's default 1 MB body-size limit — contains a 500,000-digit numeric literal that blocks the handling thread for approximately 3 seconds. Spring Boot has no default size limit for application/json request bodies. No parser configuration option (withStrictMode, withKeepStrings) prevents this. All three primary entry points are affected: new JSONObject(String), new JSONArray(String), and XML.toJSONObject(String).

This vulnerability is distinct from CVE-2023-5072 (which addressed StackOverflowError from deeply nested JSON structures via a try/catch in nextValue()) and from CVE-2022-45688 (which addressed recursive XML nesting depth). The numeric string length issue has been present since BigInteger support was introduced in release 20150729 and has never been fixed in any subsequent release.

Attack Complexity is rated High because successful exploitation requires the target application to be using org.json specifically (rather than the default Jackson library used by Spring Boot), and requires the developer to have explicitly passed user-controlled input to new JSONObject() or equivalent. These are deployment conditions beyond the attacker's control. See Section 6 for the full CVSS rationale and Section 8 for the comparison with Jackson's treatment of the same issue class.

This vulnerability was reproduced locally against json-20260522.jar with full evidence provided below.


2. Vulnerability Description

JSONTokener.nextSimpleValue() accumulates characters into a StringBuilder with no length limit until it hits a structural JSON character:

JSONTokener.java:500–504:

StringBuilder sb = new StringBuilder();
while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
    sb.append(c);     // unbounded — no length check
    c = this.next();
}

The accumulated string is passed to JSONObject.stringToValue() → stringToNumber(), which calls new BigInteger(val) with zero size guard:

JSONObject.java:2738:

BigInteger bi = new BigInteger(val);   // val can be arbitrarily large; no guard

BigInteger(String) has O(n^1.585) time complexity due to its internal Karatsuba multiplication during construction. A 100,000-digit input takes ~120 ms; a 1,000,000-digit input takes ~12 seconds. The decimal path (new BigDecimal(val), reached when the string contains a . or exponent) is equally affected.

No configuration option prevents this. withStrictMode(true) and withKeepStrings(true) are not checked in the nextSimpleValue() → stringToNumber() call chain. Confirmed by execution: both options still produce BigInteger in ~120 ms for a 100K-digit input.

Relationship to CVE-2023-5072: CVE-2023-5072 (fixed in release 20231013) catches StackOverflowError thrown by deeply nested JSON structures ({[ brackets) inside nextValue():

} catch (StackOverflowError e) {
    throw new JSONException("JSON Array or Object depth too large to process.", e);
}

This fix is in nextValue() and covers only recursive object/array structure depth. It has no effect on the numeric string length path in nextSimpleValue() → stringToNumber(). The BigInteger length issue was not addressed in 20231013 or in any subsequent release.


3. Affected Code Locations

| File | Lines | Description | |------|-------|-------------| | JSONTokener.java | 500–504 | nextSimpleValue() — unbounded character accumulation into…

Record
GHSA-ghc9-756g-vrcv
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-770
Updated
2026-11-09
NVD5.9

JSON-java is a reference implementation of a JSON package in Java. From version 20150729 through 20260522, JSONTokener.nextSimpleValue can accumulate unbounded numeric tokens before JSONObject.stringToNumber passes them to BigInteger or BigDecimal conversion without a length limit. An application that parses attacker-controlled JSON or XML through JSONObject, JSONArray, or XML.toJSONObject can spend super-linear CPU time converting a sufficiently long numeric literal, blocking request-handling threads and causing denial of service. Strict mode and keep-strings settings in JSONParserConfiguration do not prevent the affected conversion path. Version 20260719 limits numeric conversion length.

Record
CVE-2026-59171
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-770
Updated
2026-11-11
OSV5.9

JSON-java: JSONTokener Unbounded Numeric String Resource-Exhaustion DoS

JSON-java is a reference implementation of a JSON package in Java. From version 20150729 through 20260522, JSONTokener.nextSimpleValue can accumulate unbounded numeric tokens before JSONObject.stringToNumber passes them to BigInteger or BigDecimal conversion without a length limit. An application that parses attacker-controlled JSON or XML through JSONObject, JSONArray, or XML.toJSONObject can spend super-linear CPU time converting a sufficiently long numeric literal, blocking request-handling threads and causing denial of service. Strict mode and keep-strings settings in JSONParserConfiguration do not prevent the affected conversion path. Version 20260719 limits numeric conversion length.

Record
CVE-2026-59171
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-770
Updated
2026-11-08
OSVGHSA-ghc9-756g-vrcv5.9

JSON-java: JSONTokener Has Unbounded Numeric String Resource-Exhaustion DoS

1. Executive Summary

JSON-java version 20260522 contains an unguarded path from an HTTP request body to unbounded BigInteger and BigDecimal construction. JSONTokener.nextSimpleValue() accumulates numeric characters into a StringBuilder with no length cap, then passes the full string to JSONObject.stringToNumber(), which calls new BigInteger(val) or new BigDecimal(val) directly. Both constructors have polynomial time complexity (O(n^1.585) for BigInteger).

A 488 KB JSON body — well within nginx's default 1 MB body-size limit — contains a 500,000-digit numeric literal that blocks the handling thread for approximately 3 seconds. Spring Boot has no default size limit for application/json request bodies. No parser configuration option (withStrictMode, withKeepStrings) prevents this. All three primary entry points are affected: new JSONObject(String), new JSONArray(String), and XML.toJSONObject(String).

This vulnerability is distinct from CVE-2023-5072 (which addressed StackOverflowError from deeply nested JSON structures via a try/catch in nextValue()) and from CVE-2022-45688 (which addressed recursive XML nesting depth). The numeric string length issue has been present since BigInteger support was introduced in release 20150729 and has never been fixed in any subsequent release.

Attack Complexity is rated High because successful exploitation requires the target application to be using org.json specifically (rather than the default Jackson library used by Spring Boot), and requires the developer to have explicitly passed user-controlled input to new JSONObject() or equivalent. These are deployment conditions beyond the attacker's control. See Section 6 for the full CVSS rationale and Section 8 for the comparison with Jackson's treatment of the same issue class.

This vulnerability was reproduced locally against json-20260522.jar with full evidence provided below.


2. Vulnerability Description

JSONTokener.nextSimpleValue() accumulates characters into a StringBuilder with no length limit until it hits a structural JSON character:

JSONTokener.java:500–504:

StringBuilder sb = new StringBuilder();
while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
    sb.append(c);     // unbounded — no length check
    c = this.next();
}

The accumulated string is passed to JSONObject.stringToValue() → stringToNumber(), which calls new BigInteger(val) with zero size guard:

JSONObject.java:2738:

BigInteger bi = new BigInteger(val);   // val can be arbitrarily large; no guard

BigInteger(String) has O(n^1.585) time complexity due to its internal Karatsuba multiplication during construction. A 100,000-digit input takes ~120 ms; a 1,000,000-digit input takes ~12 seconds. The decimal path (new BigDecimal(val), reached when the string contains a . or exponent) is equally affected.

No configuration option prevents this. withStrictMode(true) and withKeepStrings(true) are not checked in the nextSimpleValue() → stringToNumber() call chain. Confirmed by execution: both options still produce BigInteger in ~120 ms for a 100K-digit input.

Relationship to CVE-2023-5072: CVE-2023-5072 (fixed in release 20231013) catches StackOverflowError thrown by deeply nested JSON structures ({[ brackets) inside nextValue():

} catch (StackOverflowError e) {
    throw new JSONException("JSON Array or Object depth too large to process.", e);
}

This fix is in nextValue() and covers only recursive object/array structure depth. It has no effect on the numeric string length path in nextSimpleValue() → stringToNumber(). The BigInteger length issue was not addressed in 20231013 or in any subsequent release.


3. Affected Code Locations

| File | Lines | Description | |------|-------|-------------| | JSONTokener.java | 500–504 | nextSimpleValue() — unbounded character accumulation into…

Record
GHSA-ghc9-756g-vrcv
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-770
Updated
2026-11-09
OSVopenSUSE-SU-2026:12514-1No score

json-java-20260814-1.1 on GA media

These are all security issues fixed in the json-java-20260814-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:12514-1
Updated
2026-11-11

Affected products

Affected packages

Affected packages
PackageAffectedFixed
org.json:json
Maven
20150729 up to 20260719
20260719
org.json:json
Maven
20150729 up to 20260719, plus listed versions
2015112320160212201608072016081020170516
Show 20 moreShow less
2017101820180130201808132019072220200518202011152021030720211205202203202022092420230227202306182023101320240205202403032024122420250107202505172025122420260522
20260719
json-java
openSUSE:Tumbleweed
before 20260814-1.1
20260814-1.1

History

History
RecordedChangedSources
affected, aliases, referencesNVD, OSV
publishedEUVD
referencesCVE List
publishedEUVD
affected, referencesOSV
affected, facts, referencesGitHub Advisories, OSV
aliases, referencesNVD, OSV
first indexedCVE List, EUVD

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

In short

CVE-2026-59171 is a medium vulnerability (CVSS 5.9) in Stleary Json-java, published November 6, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.55%, the 46th percentile. Fixed in org.json:json 20260719.

References

Show 6 moreShow less
This page doesn't list everything

Left out here: the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open