CVE-2022-31116

Incorrect handling of invalid surrogate pair characters in ujson

Published Jul 5, 2022 CVSS 3.1 · 7.5 High EPSS 2.5% KEV · Not listed
Description
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2022-6438 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.
Github GHSA Github GHSA GHSA-wpqr-jcpx-745r Incorrect handling of invalid surrogate pair characters
Ubuntu USN Ubuntu USN USN-6629-1 UltraJSON vulnerabilities
Ubuntu USN Ubuntu USN USN-6629-3 UltraJSON vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 22, 2025, 5:52 PM
Reserved
May 18, 2022, 12:00 AM
Status
Modified
Published
Jul 5, 2022, 6:15 PM
Modified
Jun 17, 2026, 4:44 AM
Severity
Moderate
Public date
Jul 2, 2022, 12:00 AM