ujson memory leak in dumps() default handler
- Exploited
- No known exploitation
- Fix
- Fixed in 6.0.0
- Who is exposed
- Not reported
Summary
UltraJSON's ujson package leaks memory in its dumps() function when a caller-supplied default handler returns objects that can't be serialized. A remote attacker who can repeatedly trigger this encoding, without logging in or any action by a user, can gradually exhaust the process's memory.
Written by a model
Original description
UltraJSON 4.2.0 before 6.0.0 contains a memory leak in Object_beginTypeContext() that fails to release objects returned by a caller-supplied default handler. Attackers who can repeatedly trigger encoding of values whose default handler returns non-serializable objects leak one object per failed call, gradually exhausting process memory.
What to do
Upgrade to a fixed version: 6.0.0.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-145573 (UltraJSON 4.2.0 before 6.0.0 Memory Leak via ujson.dumps() default Handler), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-145573 (entry last updated 2026-12-05):
Affected:
- PyPI package ujson: from 4.2.0, fixed in 6.0.0
Fixed versions: 6.0.0.
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
CISA KEV: CVE-2026-145573 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-145573 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Packages (PyPI): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/ultrajson/ultrajson/security/advisories/GHSA-8g3h-c45c-7pg3
- https://github.com/ultrajson/ultrajson/commit/12492c2deb0e60ac66da40dc15f06ba967ed3e0a
- https://github.com/ultrajson/ultrajson/releases/tag/6.0.0
- https://github.com/ultrajson/ultrajson/blob/5.13.0/src/ujson/python/objToJSON.c#L543-L590
- https://www.vulncheck.com/advisories/ultrajson-4.2.0-before-6.0.0-memory-leak-via-ujson-dumps-default-handler
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-145573
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-145573"}.Affected versions
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure17/25No login or user action needed per the CVSS vector, reachable over the network without a login · Unknown: No advisory context yet
- Reach16/20ujson: 7.1M downloads a week
- Severity6.3/10CVSS 6.3
- No patch0/5No signal
What would change the score
- Would score about 84 if added to CISA KEV
- Would score about 79 if CISA's SSVC rates exploitation active
- Would score about 44 if advisories confirm default setups are exposed
Impact
- Widely usedujson has 7.1m weekly downloads. pypistats.org2.9k packages depend on ujson. deps.dev
Timeline
- CVE published
- First seen by cve.now
Evidence 7
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · ultrajson/ultrajson · Advisory GHSA-8g3h-c45c-7pg3 |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-145573 |
| Record | NVD · CVE-2026-145573 |
| Other links 4 | |
| Patch | GitHub · ultrajson/ultrajson · Commit 12492c2d |
| Repository | GitHub · ultrajson/ultrajson · Release 6.0.0 |
| Repository | GitHub · ultrajson/ultrajson · src/ujson/python/objToJSON.c · L543-L590 |
| Link | vulncheck.com · advisories/ultrajson-4.2.0-before-6.0.0-memory-leak-via-ujson-dumps-default-handler |
Questions about CVE-2026-145573
Is CVE-2026-145573 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
Which versions are affected by CVE-2026-145573?
ujson (PyPI): from 4.2.0 before 6.0.0.
Source: cve.now feed data
How do I fix CVE-2026-145573?
Upgrade to a fixed version: 6.0.0.
Source: cve.now feed data
Related
- CVE-2026-44660UltraJSON: Memory Leak in ujson.dump() on Write Failure
- CVE-2026-32875UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop
- CVE-2026-32874UltraJSON has a Memory Leak parsing large integers allows DoS
- CVE-2022-31116Incorrect handling of invalid surrogate pair characters in ujson
- CVE-2026-54911UltraJSON: Malformed/Truncated UTF-8 Accepted and Silently Rewritten in ujson.dumps()
- CVE-2022-31117Double free of buffer during string decoding in ujson
No corrections so far. Something wrong on this page? Report an error.