VDB

CVE-2022-31116

CVE-2022-31116 PUBLISHED CVSS 7.5 HIGH

Incorrect handling of invalid surrogate pair characters in ujson

Reported by github_m · Published July 5, 2022

ujson is fixed in 5.4.0 (PyPI)

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
ujsonPyPI5.4.0
ultrajsonultrajson_project5.4.0

Risk scores

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

Affected products

VendorProductVersions
ultrajsonultrajson< 5.4.0
PyPIujson0
alpinepy3-ujson0
ultrajsonultrajson0

Timeline

  • Jul 5, 2022 CVE Published
  • Jul 5, 2022 PoC Published
  • Jul 6, 2022 EPSS Score (30 in total, the first dated here)
  • Mar 9, 2026 Security Advisory (20 in total, the first dated here)
  • Mar 20, 2026 Distribution Patch (17 in total, the first dated here)
  • Jun 25, 2026 Coalition ESS Score

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2022-31116
vulnetix vdb fixes CVE-2022-31116

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-31116/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›