CVE-2022-31117: Double free of buffer during string decoding in ujson
Noroxi assessment
Priority: Monitor (action score 24/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 1.8% (FIRST EPSS); higher than 79.6% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: py3-ujson (Alpine:v3.16) 5.4.0-r0; ujson (Debian:12) 5.4.0-1; python-ujson (openSUSE:Leap 15.3) 1.35-150100.3.5.1.
Low priority for now. Upgrade to py3-ujson (Alpine:v3.16) 5.4.0-r0; ujson (Debian:12) 5.4.0-1; python-ujson (openSUSE:Leap 15.3) 1.35-150100.3.5.1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. In versions prior to 5.4.0 an error occurring while reallocating a buffer for string decoding can cause the buffer to get freed twice. Due to how UltraJSON uses the internal decoder, this double free is impossible to trigger from Python. This issue has been resolved in version 5.4.0 and all users should upgrade to UltraJSON 5.4.0. There are no known workarounds for this issue.
- Published
- Jul 5, 2022
- Updated
- Jun 17, 2026
- EPSS
- 1.8% · 79th percentile
- CWE
- CWE-415
Report tools
Action score
24
Low priority for now.
- CVSS
- 23 / 40 · 5.9 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 1.8%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 5.9
- CNA · GitHub_M
- 5.9
- agree
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| ultrajson project | ultrajson | cpe:2.3:a:ultrajson_project:ultrajson |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
ultrajson ultrajson
- < 5.4.0affected
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- fedoraproject fedora35
- fedoraproject fedora36
- ultrajson project ultrajsonbefore 5.4.0
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.16 | py3-ujson | before 5.4.0-r0 | 5.4.0-r0 |
| Debian:12 | ujson | before 5.4.0-1 | 5.4.0-1 |
| openSUSE:Leap 15.3 | python-ujson | before 1.35-150100.3.5.1 | 1.35-150100.3.5.1 |
| openSUSE:Tumbleweed | python-ujson | before 5.10.0-1.5 | 5.10.0-1.5 |
| PyPI | ujson | before 5.4.0 | 5.4.0 |
| Red Hat:openstack:16.2::el8 | python-ujson | before 0:2.0.3-3.el8ost | 0:2.0.3-3.el8ost |
| Red Hat:openstack:16.2::el8 | python-ujson-debugsource | before 0:2.0.3-3.el8ost | 0:2.0.3-3.el8ost |
| Red Hat:openstack:16.2::el8 | python3-ujson | before 0:2.0.3-3.el8ost | 0:2.0.3-3.el8ost |
| Red Hat:openstack:16.2::el8 | python3-ujson-debuginfo | before 0:2.0.3-3.el8ost | 0:2.0.3-3.el8ost |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | python-ujson | before 1.35-150100.3.5.1 | 1.35-150100.3.5.1 |
Same product
ultrajson project: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-44660UltraJSON: Memory Leak in ujson.dump() on Write Failure34Monitor
- CVE-2022-31116Incorrect handling of invalid surrogate pair characters in ujson31Monitor
- CVE-2026-32875UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop30Monitor
Published before and after this one in the same product
- ← EarlierCVE-2021-45958Dec 31, 2021 · UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in Buffer_AppendIndentUnchecked (called from encode).23Monitor
- Later →CVE-2026-32874Mar 19, 2026 · UltraJSON has a Memory Leak parsing large integers allows DoS30Monitor
- Later →CVE-2026-54911Jun 22, 2026 · UltraJSON: Malformed/Truncated UTF-8 Accepted and Silently Rewritten in ujson.dumps()26Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| alpine:py3-ujson | 5.4.0-r0 · Alpine:v3.16 | Package registry (OSV) |
| debian:ujson | 5.4.0-1 · Debian:12 | Package registry (OSV) |
| opensuse:python-ujson | 1.35-150100.3.5.1 · openSUSE:Leap 15.3 | Package registry (OSV) |
| PyPI:ujson | 5.4.0 | Package registry (OSV) |
| red hat:python-ujson | 0:2.0.3-3.el8ost · Red Hat:openstack:16.2::el8 | Package registry (OSV) |
| red hat:python-ujson-debugsource | 0:2.0.3-3.el8ost · Red Hat:openstack:16.2::el8 | Package registry (OSV) |
| red hat:python3-ujson | 0:2.0.3-3.el8ost · Red Hat:openstack:16.2::el8 | Package registry (OSV) |
| red hat:python3-ujson-debuginfo | 0:2.0.3-3.el8ost · Red Hat:openstack:16.2::el8 | Package registry (OSV) |
| suse:python-ujson | 1.35-150100.3.5.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP3 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-415 · Double FreeCVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (3 more)Show less
- github.com/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/
Vendor advisories and official records. Exploit/PoC links are deliberately left out.