Read the docs
TI-2022-13161 Aliases CVE-2022-31117GHSA-fm67-cv37-96ff

Double free of buffer during string decoding in ujson

Priority LOW 30CWE-415Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
High
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Partial Red Hat: 2 fixed, 1 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-415 and the CVSS impact.

Summary

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.01876 79th percentileScored 2026-11-07
Fix Partial ultrajson (ultrajson): 5.4.0ujson (PyPI): 5.4.0Red Hat: 2 advisoriesRed Hat: 2 fixed, 1 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
ultrajsonultrajsonbefore 5.4.05.4.0Patch availableCNA
—ujson (PyPI)before 5.4.05.4.0Patch availableGHSA-fm67-cv37-96ff
  • ultrajson Vendorultrajson Affected before 5.4.0 Fixed in 5.4.0 Patch available CNA
  • ujson (PyPI) Vendor— Affected before 5.4.0 Fixed in 5.4.0 Patch available GHSA-fm67-cv37-96ff

CPE configurations NVD · 3

CPEVersionsRoleVendor
cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:*before 5.4.0Vulnerableultrajson
cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*35VulnerableFedoraproject
cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*36VulnerableFedoraproject
  • cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:* Versions before 5.4.0 Vulnerable ·ultrajson
  • cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
  • cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject

Remediation

  • Fix · CNA ultrajson (ultrajson) Fixed in 5.4.0
  • Fix · GHSA-fm67-cv37-96ff ujson (PyPI) Fixed in 5.4.0 Advisory →

Red Hat 2 advisories

  • RHSA-2022:8864 Released 2022-12-07 · Red Hat rating Moderate
    Red Hat OpenStack Platform 16.1.9 (python-ujson) security update
    • Red Hat OpenStack Platform 16.1 python-ujson-2.0.3-3.el8ost, python3-ujson-2.0.3-3.el8ost
  • RHSA-2022:8850 Released 2022-12-07 · Red Hat rating Moderate
    Red Hat OpenStack Platform 16.2.4 (python-ujson) security update
    • Red Hat OpenStack Platform 16.2 python-ujson-2.0.3-3.el8ost, python3-ujson-2.0.3-3.el8ost

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Advisory ·

    ultrajson — FEDORA-2022-1b2b8d5177

    2 records Highest priority Priority HIGH 1 HIGH, 1 LOW

    Other records, highest priority first

    • TI-2022-13160 Incorrect handling of invalid surrogate pair characters in ujsonPriority HIGH 72

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat OpenStack Platform 13 (Queens)AffectedNo fix planned: Out of support scope
Red Hat OpenStack Platform 16.1Fixed RHSA-2022:8864
Red Hat OpenStack Platform 16.2Fixed RHSA-2022:8850

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-31117
  2. 2026-10-03 Alias added: GHSA-fm67-cv37-96ff

References

  • TI-2026-32560 UltraJSON: Memory Leak in ujson.dump() on Write Failure CVSS 4.0HIGH 8.7
  • TI-2026-25335 UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop CVSS 3.1HIGH 7.5
  • TI-2022-13160 Incorrect handling of invalid surrogate pair characters in ujson CVSS 3.1HIGH 7.5
  • TI-2026-25334 UltraJSON has a Memory Leak parsing large integers allows DoS CVSS 3.1HIGH 7.5
  • TI-2026-39683 UltraJSON: Malformed/Truncated UTF-8 Accepted and Silently Rewritten in ujson.dumps() CVSS 3.1MEDIUM 6.5
  • TI-2021-20961 UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in… CVSS 3.1MEDIUM 5.5

Sources