LiveActive security incident?Get immediate response
CVE Record

CVE-2022-31116: Incorrect handling of invalid surrogate pair characters in ujson

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.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

UltraJSON versions before 5.4.0 can incorrectly parse malformed Unicode surrogate escapes in JSON. For businesses, the main concern is services that trust parsed JSON from outside sources: data may be corrupted, and dictionary values may be confused or overwritten.

Executive priority

Treat this as a high-priority dependency remediation for systems ingesting untrusted JSON. It is not evidenced as actively exploited here, but the affected component may sit in externally reachable data paths.

Technical view

The issue is in ujson decoding of escaped surrogate characters that are not valid surrogate pairs. Affected versions decode these incorrectly, creating potential string corruption, key confusion, and dictionary value overwrites. Version 5.4.0 changed behavior to preserve lone surrogates like Python's standard json module.

Likely exposure

Exposure is likely in Python applications using ultrajson/ujson below 5.4.0, especially APIs, webhooks, ingestion jobs, or services parsing JSON from untrusted sources. The provided sources do not identify affected downstream products beyond UltraJSON itself.

Exploitation context

The source bundle does not show CISA KEV listing or cited active exploitation. Practical risk depends on whether attackers can supply JSON that an affected ujson parser consumes in security- or data-sensitive paths.

Researcher notes

Focus assessment on parser reachability and trust boundaries. The advisory names all users parsing JSON from untrusted sources as vulnerable, with no workaround besides upgrading. Evidence supports UltraJSON below 5.4.0 only.

Mitigation direction

  • Upgrade UltraJSON/ujson to version 5.4.0 or later.
  • Inventory Python lockfiles, images, and OS packages for ujson below 5.4.0.
  • Prioritize services that parse JSON from users, partners, webhooks, or public APIs.
  • If upgrade is delayed, check vendor guidance; sources state no known workaround.
  • Run regression tests for JSON parsing behavior after upgrading.

Validation and detection

  • Check SBOMs and dependency manifests for ultrajson or ujson versions below 5.4.0.
  • Confirm the installed runtime package version in production images and hosts.
  • Identify code paths using ujson to parse externally supplied JSON.
  • Verify tests cover malformed Unicode handling and dictionary key preservation.
  • Review Fedora or distribution package advisories where OS packages supply ujson.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-670: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2022-31116 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H3.93.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2022-31116Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
ultrajsonultrajson< 5.4.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-670 · source CWE mapping

Always-Incorrect Control Flow Implementation

Always-Incorrect Control Flow Implementation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.