7.5high
UltraJSON has a Memory Leak parsing large integers allows DoS
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.56% (higher than 48% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-wgvc-ghv9-3pmmPYSEC-2026-2291
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ultrajson ultrajson | >= 5.4.0, < 5.12.0 | CVE List |
| python-ujson | Not specified | CVE List |
| ujson (PyPI) | from 5.4.0 before 5.12.0 | GitHub Advisory Database, PyPA Advisory Database |
| ultrajson_project ultrajson | from 5.4.0 before 5.12.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| redhat-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
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)
NVD (es)
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.
References
| https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wgvc-ghv9-3pmm | advisory, vendor-advisory, web | |
| https://github.com/ultrajson/ultrajson/commit/4baeb950df780092bd3c89fc702a868e99a3a1d2 | fix, patch, web | |
| https://github.com/ultrajson/ultrajson/releases/tag/5.12.0 | advisory, product, release-notes, web | |
| https://access.redhat.com/security/cve/CVE-2026-32874 | vdb-entry, web | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2449411 | issue-tracking, report | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32874.json | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-32874 | advisory | |
| https://github.com/ultrajson/ultrajson | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32874 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-wgvc-ghv9-3pmm changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-32874 changed 2026-07-15 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2291 changed 2026-07-13 | CC-BY-4.0 |