CVE-2022-31116
HIGH 7.5CVSS 3.1Incorrect handling of invalid surrogate pair characters
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.
- Published
- 5 Jul 2022
- Last modified
- 7 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-670
- Also known as
- GHSA-wpqr-jcpx-745rPYSEC-2026-1057
- Sources
- NVDJSONOSV GHSA-wpqr-jcpx-745rJSONOSV PYSEC-2026-1057JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | ultrajson_project | ultrajsoncpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:* |
< 5.4.0 | 5.4.0 |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
= 35 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* |
= 36 | |
| OSV | PyPI | ujson | < 5.4.0 | 5.4.0 |
References
- https://github.com/ultrajson/ultrajson/commit/67ec07183342589d602e0fcf7bb1ff3e19272687 · Patch, Third Party Advisory, WEB
- https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745r · Exploit, Third Party Advisory, WEB
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/
- https://nvd.nist.gov/vuln/detail/CVE-2022-31116 · ADVISORY
- https://github.com/ultrajson/ultrajson · PACKAGE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2 · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7 · WEB
- https://pypi.org/project/ujson · PACKAGE
- https://github.com/advisories/GHSA-wpqr-jcpx-745r · ADVISORY
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 5 Jul 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 6 Jul 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 5 Jul 2022)