CVE-2022-31116
mediumpriority · track · 31EPSS 0.025 · 85 %ileDEEURUUSEPSS · scored 2026-10-27
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.
remediations
Vendor fix, mitigation, or workaround guidance, as published by each source.
A vendor fix is available.
- Fixedpython-ujson-0:2.0.3-3.el8ost.src as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython-ujson-debugsource-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython-ujson-debugsource-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython3-ujson-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython3-ujson-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython3-ujson-debuginfo-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython3-ujson-debuginfo-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.2redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8850 - Fixedpython-ujson-0:2.0.3-3.el8ost.src as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython-ujson-debugsource-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython-ujson-debugsource-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython3-ujson-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython3-ujson-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython3-ujson-debuginfo-0:2.0.3-3.el8ost.ppc64le as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864 - Fixedpython3-ujson-debuginfo-0:2.0.3-3.el8ost.x86_64 as a component of Red Hat OpenStack Platform 16.1redhat_csaf
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
https://access.redhat.com/errata/RHSA-2022:8864
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–critical · 5–9.1
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (22)
Products and version ranges known to be affected.
advisories (5)
Vendor and ecosystem advisories describing this.
- RHSA-2022:8850Red Hat Security Advisory: Red Hat OpenStack Platform 16.2.4 (python-ujson) security update2022-12-07csaf · redhat_csafUS
An update for python-ujson is now available for Red Hat OpenStack Platform 16.2.4 (Train) for Red Hat Enterprise Linux (RHEL) 8.4. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.
- RHSA-2022:8864Red Hat Security Advisory: Red Hat OpenStack Platform 16.1.9 (python-ujson) security update2022-12-07csaf · redhat_csafUS
An update for python-ujson is now available for Red Hat OpenStack Platform 16.1.9 (Train) for Red Hat Enterprise Linux (RHEL) 8.2. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.
- WID-SEC-W-2022-2265Red Hat OpenStack: Mehrere SchwachstellenDeutsch2022-12-07csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in Red Hat OpenStack ausnutzen, um die Verfügbarkeit, Vertraulichkeit und Integrität zu gefährden.
- GHSA-wpqr-jcpx-745rIncorrect handling of invalid surrogate pair characters2022-07-05ghsa · osvUS
### Impact _What kind of vulnerability is it? Who is impacted?_ Anyone parsing JSON from an untrusted source is vulnerable. 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. Examples: ```python # An unpaired high surrogate character is ignored. >>> ujson.loads(r'"\uD800"') '' >>> ujson.loads(r'"\uD800hello"') 'hello' # An unpaired low surrogate character is preserved. >>> ujson.loads(r'"\uDC00"') '\udc00' # A pair of surrogates with additional non surrogate characters pair up in spite of being invalid. >>> ujson.loads(r'"\uD800foo bar\uDC00"') 'foo bar𐀀' ``` ### Patches _Has the problem been patched? What versions should users upgrade to?_ Users should upgrade to UltraJSON 5.4.0. 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: ```python3 >>> ujson.loads(r'"\uD800"') '\ud800' >>> ujson.loads(r'"\uD800hello"') '\ud800hello' >>> ujson.loads(r'"\uDC00"') '\udc00' >>> ujson.loads(r'"\uD800foo bar\uDC00"') '\ud800foo bar\udc00' ``` ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Short of switching to an entirely different JSON library, there are no safe alternatives to upgrading. ### For more information If you have any questions or comments about this advisory: * Open an issue in [UltraJSON](http://github.com/ultrajson/ultrajson/issues)
- PYSEC-2026-1057Incorrect handling of invalid surrogate pair characters2026-07-06vendor · osvUS
### Impact _What kind of vulnerability is it? Who is impacted?_ Anyone parsing JSON from an untrusted source is vulnerable. 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. Examples: ```python # An unpaired high surrogate character is ignored. >>> ujson.loads(r'"\uD800"') '' >>> ujson.loads(r'"\uD800hello"') 'hello' # An unpaired low surrogate character is preserved. >>> ujson.loads(r'"\uDC00"') '\udc00' # A pair of surrogates with additional non surrogate characters pair up in spite of being invalid. >>> ujson.loads(r'"\uD800foo bar\uDC00"') 'foo bar𐀀' ``` ### Patches _Has the problem been patched? What versions should users upgrade to?_ Users should upgrade to UltraJSON 5.4.0. 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: ```python3 >>> ujson.loads(r'"\uD800"') '\ud800' >>> ujson.loads(r'"\uD800hello"') '\ud800hello' >>> ujson.loads(r'"\uDC00"') '\udc00' >>> ujson.loads(r'"\uD800foo bar\uDC00"') '\ud800foo bar\udc00' ``` ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Short of switching to an entirely different JSON library, there are no safe alternatives to upgrading. ### For more information If you have any questions or comments about this advisory: * Open an issue in [UltraJSON](http://github.com/ultrajson/ultrajson/issues)
also known as (7)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (18)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2022-31116/cnnvd
- https://github.com/ultrajson/ultrajson/commit/67ec07183342589d602e0fcf7bb1ff3e19272687cnnvd
- https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745rcnnvd
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/cnnvd
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/cnnvd
- https://packetstormsecurity.com/files/170153/Red-Hat-Security-Advisory-2022-8864-01.htmlcnnvd
- https://vigilance.fr/vulnerability/UltraJSON-read-write-access-via-Surrogate-Pair-Characters-38905cnnvd
- https://www.auscert.org.au/bulletins/ESB-2022.3889cnnvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan