CVE-2026-32874: Ujson Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-wgvc-ghv9-3pmm
CVSS 7.5
CWE-401
Published
Advisory Summary

CVE-2026-32874 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-401: Missing Release of Memory after Effective Lifetime) affecting Ujson libraries in the PyPI ecosystem. The issue involves ultrajson has a memory leak parsing large integers allows dos. Remediation is available by upgrading affected packages to version 5.12.0.

CVE-2026-32874 at a Glance

CVE Identifier CVE-2026-32874
GHSA Identifier GHSA-wgvc-ghv9-3pmm
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-401: Missing Release of Memory after Effective Lifetime
Affected Product Ujson
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-32874

To remediate this vulnerability, upgrade all affected Ujson dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ujson fixed: 5.12.0
pip install ujson>=5.12.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ujson

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-32874, inspect your installed packages using pip:

pip show ujson

Analyze the terminal output to locate any version of Ujson in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.12.0), your application is affected.

Note: The pip show ujson command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-401: Missing Release of Memory after Effective Lifetime, where the product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse. In Ujson, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

#### Summary ujson 5.4.0 to 5.11.0 inclusive contain an accumulating memory leak in JSON parsing _large_ (outside of the range [-2^63, 2^64 - 1]) integers. #### Exploitability Any service that calls `ujson.load()`/`ujson.loads()`/`ujson.decode()` on untrusted inputs is affected and vulnerable to denial of service attacks. #### Details The leaked memory is a copy of the string form of the integer plus an additional NULL byte. The leak occurs irrespective of whether the integer parses successfully or is rejected due to having more than `sys.get_int_max_str_digits()` digits, meaning that any sized leak per malicious JSON can be achieved provided that there is no limit on the overall size of the payload. ```python ujson.loads(str(2 ** 64 - 1)) # No leak ujson.loads(str(2 ** 64)) # Leaks ujson.loads(str(10 ** sys.get_int_max_str_digits())) # Leaks and raises ValueError ``` #### Fix The leak is fixed in `ujson 5.12.0` (4baeb950df780092bd3c89fc702a868e99a3a1d2). There are no workarounds beyond upgrading to an unaffected version. #### Credits Discovered by Cameron Criswell/Skevros using Coverage-guided fuzzing (libFuzzer + AddressSanitizer)

CVE-2026-32874 Affected Ujson Versions

1 component(s)
Fixed Versions:
5.12.0
Product / Package Ecosystem Affected Versions Fixed Version
ujson
PyPI
≥ 5.4.0
< 5.12.0
5.12.0

References

Frequently Asked Questions

What is CVE-2026-32874?
CVE-2026-32874 is a security vulnerability in Ujson involving UltraJSON has a Memory Leak parsing large integers allows DoS under CWE-401: Missing Release of Memory after Effective Lifetime.
Which Ujson versions are affected?
Affected versions include releases prior to 5.12.0 across affected packages: ujson.
What version fixes CVE-2026-32874?
Upgrading to 5.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ujson affected?
Yes, ujson is affected in releases prior to 5.12.0. Upgrade your dependency to 5.12.0 or later.
What is the CVSS score of CVE-2026-32874?
CVE-2026-32874 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-32874?
CVE-2026-32874 is classified under CWE-401: Missing Release of Memory after Effective Lifetime (The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.).
How can I check PyPI dependencies for CVE-2026-32874?
Run the dependency tree command: 'pip show ujson'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wgvc-ghv9-3pmm",
  "modified" : "2026-03-20T21:19:48Z",
  "published" : "2026-03-18T13:01:15Z",
  "aliases" : [ "CVE-2026-32874" ],
  "summary" : "UltraJSON has a Memory Leak parsing large integers allows DoS ",
  "details" : "#### Summary\n\nujson 5.4.0 to 5.11.0 inclusive contain an accumulating memory leak in JSON parsing _large_ (outside of the range [-2^63, 2^64 - 1]) integers.\n\n#### Exploitability\n\nAny service that calls `ujson.load()`/`ujson.loads()`/`ujson.decode()` on untrusted inputs is affected and vulnerable to denial of service attacks.\n\n#### Details\n\nThe leaked memory is a copy of the string form of the integer plus an additional NULL byte. The leak occurs irrespective of whether the integer parses successfully or is rejected due to having more than `sys.get_int_max_str_digits()` digits, meaning that any sized leak per malicious JSON can be achieved provided that there is no limit on the overall size of the payload.\n\n```python\nujson.loads(str(2 ** 64 - 1))  # No leak\nujson.loads(str(2 ** 64))  # Leaks\nujson.loads(str(10 ** sys.get_int_max_str_digits()))  # Leaks and raises ValueError\n```\n\n#### Fix\n\nThe leak is fixed in `ujson 5.12.0` (4baeb950df780092bd3c89fc702a868e99a3a1d2). There are no workarounds beyond upgrading to an unaffected version.\n\n#### Credits\n\nDiscovered by Cameron Criswell/Skevros using Coverage-guided fuzzing (libFuzzer + AddressSanitizer)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ujson"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.0"
      }, {
        "fixed" : "5.12.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.11.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wgvc-ghv9-3pmm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32874"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ultrajson/ultrajson/commit/4baeb950df780092bd3c89fc702a868e99a3a1d2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ultrajson/ultrajson"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ultrajson/ultrajson/releases/tag/5.12.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-401" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-18T13:01:15Z",
    "nvd_published_at" : "2026-03-20T02:16:35Z"
  }
}