AnalysisSecurityPatch available

org.json CVE-2026-59171: long numbers stall threads, Jackson unaffected

A medium-severity CPU-exhaustion flaw in org.json is fixed in 20260719, but for most Java teams the real work is finding org.json in their dependency trees and putting a real cap on JSON body size.

Khalid Aboubakr Engineering DeskPublished

Automated engineering analysis by the Khalid Aboubakr Engineering Desk, from the primary sources listed below. Not reviewed by a person before publication. About the desk

Bottom line

CVE-2026-59171 is fixed in org.json:json 20260719, and every version from 20150729 up to that release is affected. Only applications that pass untrusted JSON or XML to org.json are exposed; Spring Boot's default Jackson path is not. Find org.json in your dependency trees, upgrade to 20260719, and enforce a request body size limit regardless.

What happened

A denial-of-service flaw in JSON-java (Maven org.json:json) is tracked as CVE-2026-59171 / GHSA-ghc9-756g-vrcv.

From version 20150729 through 20260522, the tokenizer accumulates numeric tokens of unbounded length. It then passes them to BigInteger or BigDecimal conversion with no length limit. The affected entry points are JSONObject, JSONArray and XML.toJSONObject.

NVD states that version 20260719 limits numeric conversion length. The GitHub advisory lists 20260719 as the first patched version. NVD gives a CVSS base score of 5.9 (medium), and its record is still in "Received" status.

According to the advisory, the strict-mode and keep-strings options in JSONParserConfiguration do not block the affected path.

The advisory text was written by the reporter. It states that a body of roughly 488 KB containing a 500,000-digit literal blocked a handling thread for about 3 seconds. That figure comes from the reporter's own local run against 20260522.

The same text makes two further points:

  • Spring Boot has no default size limit for application/json request bodies.
  • Exploitation requires the application to use org.json rather than Spring Boot's default Jackson.

The advisory describes this flaw as distinct from the earlier org.json flaw CVE-2023-5072. The GitHub Advisory Database lists CVE-2023-5072 as patched in 20231013.

Why it matters

This is a CPU-amplification bug, not a memory or stack bug. Conversion cost grows super-linearly with digit count. As a result, payloads small enough to pass typical proxy limits can hold a request thread for seconds.

The advisory notes that a ~488 KB body sits well under nginx's 1 MB default client_max_body_size. The reporter's scenario estimates that about 200 concurrent requests of this size would occupy a default 200-thread Tomcat pool. Smaller pools saturate sooner.

The headline framing around nginx and Spring Boot overstates who is affected. A standard Spring Boot controller that binds @RequestBody through Jackson does not touch this code. Exposure exists only where untrusted input reaches org.json, for example:

  • hand-written new JSONObject(body) calls;
  • XML.toJSONObject on inbound XML;
  • a library that makes such calls internally.

org.json can arrive as a transitive dependency, and the evidence does not say which common libraries bring it in. Check the dependency tree rather than assuming it is absent. Note, too, that being on the classpath is not the same as being on the request path.

The parser's strictness settings do not help. Teams relying on strict mode or keep-strings for hardening gain no protection here.

Engineering assessment

Our assessment: this is a real but narrow issue, and the medium rating is fair.

The high attack-complexity rating reflects a precondition: the vulnerable call must sit on a path an attacker can reach. It does not mean the payload is hard to build. Where that precondition holds, a public JSON or XML endpoint is cheap to stall. Affected services should treat this as a prompt fix, not a backlog item.

The timing figures (about 3 seconds at ~488 KB) come from a single local run by the reporter. Production hardware and JVMs will differ. What matters is the super-linear shape: larger bodies cost disproportionately more, so body-size limits directly cap the worst case.

The announcement under-explains two things:

  1. The evidence does not document how the fix behaves. NVD says only that 20260719 "limits numeric conversion length". The reporter proposed a configurable cap defaulting to 1,000 characters, but nothing in the evidence confirms what the release actually enforces. It is also unknown whether the limit is configurable, or what happens to legitimately long numbers. Some systems do carry long numbers, such as high-precision decimals, large identifiers sent as numerals, or scientific data. If you upgrade, test those payloads.
  2. The advisory text contradicts itself. Its narrative was written against 20260522 and still says the issue was "never fixed", yet the advisory metadata lists 20260719 as patched. Trust the metadata, and expect scanners to report the range >= 20150729, < 20260719.

The advisory's defence-in-depth advice deserves more weight than a typical footnote. The advisory text states that Spring Boot imposes no default cap on JSON bodies. Many JSON APIs need far less than 1 MB per request. An explicit, smaller limit at the proxy or gateway therefore guards against this bug and against the wider class of parser-cost bugs.

Jackson-based Spring Boot services are not affected by this path. The issue does strengthen the case for explicit request size limits on Java services that accept untrusted bodies.

Is this you?

  • org.json:json at a version from 20150729 up to (but not including) 20260719 is on your runtime classpath, whether directly, transitively or shaded into a fat jar.
  • Your code, or a library you use, calls new JSONObject(...), new JSONArray(...) or XML.toJSONObject(...) on data from requests, message queues, webhooks or uploaded files.
  • Untrusted or unauthenticated clients can reach those endpoints.
  • Neither your proxy or gateway nor your application sets a body-size limit below the defaults for JSON bodies.
  • If your services parse request bodies only through Spring Boot's default Jackson and org.json never sees untrusted input, this path does not expose you. Upgrading is still sensible hygiene.

What to do

  1. Inventory first (today). Find every copy of org.json, including transitive and shaded copies:

    • mvn dependency:tree -Dincludes=org.json:json
    • ./gradlew dependencies --configuration runtimeClasspath
    • jar tf app.jar | grep org/json/JSONTokener
  2. Upgrade to org.json:json 20260719 wherever untrusted input reaches org.json. Pin the version explicitly, or use dependency management to override transitive copies. Do this promptly for internet-facing services.

  3. Test number handling before rollout. Run regression tests with your largest legitimate numeric values, such as long decimals and big integers. This confirms the new length limit does not reject valid traffic.

  4. Cap request body size. The advisory text recommends an upstream body-size limit independent of the library fix. It suggests client_max_body_size 64k; for nginx, plus a servlet filter in Spring Boot that rejects an oversized Content-Length. This advice comes from the reporter-authored advisory text, not the maintainer. Base your limit on your real payload sizes rather than defaulting to 64k.

  5. Not vendor guidance: where org.json handles untrusted input, consider moving that parsing to your framework's primary JSON library. Also review request timeouts and thread-pool saturation alerts, so that a slow-parse incident shows up as a clear signal rather than a vague latency spike.

  6. Technical leads: add org.json:json to your software composition analysis watch list. The evidence shows at least three parser resource-exhaustion CVEs affecting it:

    • CVE-2022-45688, per the GitHub Advisory Database;
    • CVE-2023-5072;
    • CVE-2026-59171.

    Transitive copies of a library like this are easy to leave stale.

What we don't know yet

  • What 20260719 actually enforces: the default length, whether it is configurable, and how it fails. The evidence says only that it limits numeric conversion length.
  • Which upstream commits are in 20260719. OSV lists fix commits, not versions.
  • How NVD's analysis will settle. The record is in "Received" status with no analysis yet.
  • Which hardware and JVM produced the reporter's timings, and how they translate to production.
  • Which common frameworks or libraries pull in org.json transitively or pass untrusted input to it.
  • Whether anyone has observed attacks using this flaw. The evidence contains no statement either way.

The desk will revisit these points as the release notes and NVD analysis mature. Updates will appear on the Engineering Desk news page.

Sources

Latest engineering analysis

6 min read

zod-msg-tools 0.1.4: npm malware hides an auth-bypassing SQL backdoor

A fake Zod helper on npm patches Node's HTTP server at runtime and adds a hidden endpoint that sits in front of your router and auth, runs queries on your database pools and, where the psql client is present, can reach OS command execution on Postgres deployments.