Read the docs
TI-2022-13160 Aliases CVE-2022-31116GHSA-wpqr-jcpx-745r

Incorrect handling of invalid surrogate pair characters in ujson

Priority HIGH 72CWE-670Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
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.

Summary

UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library's `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.02545 85th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
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
Poc
Automatable
Yes
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-wpqr-jcpx-745r
  • 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-wpqr-jcpx-745r

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-wpqr-jcpx-745r 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-13161 Double free of buffer during string decoding in ujsonPriority LOW 30

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-31116
  2. 2026-10-03 Alias added: GHSA-wpqr-jcpx-745r

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-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-2022-13161 Double free of buffer during string decoding in ujson CVSS 3.1MEDIUM 5.9
  • TI-2021-20961 UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in… CVSS 3.1MEDIUM 5.5

Sources