Bug 2104740 (CVE-2022-31116)

Summary: CVE-2022-31116 python-ujson: improper decoding of escaped surrogate characters may lead to string corruption, key confusion or value overwriting
Product: [Other] Security Response Reporter: Avinash Hanwate <ahanwate>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: apevec, code, eglynn, fedora, jjoyce, jschluet, lhh, mail, mburns, python-sig, rhos-maint, spower
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ujson 5.4.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-10 01:33:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2106990, 2106992, 2106993, 2106994, 2106995    
Bug Blocks: 2103714    

Description Avinash Hanwate 2022-07-07 04:38:28 UTC
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.

https://github.com/ultrajson/ultrajson/commit/67ec07183342589d602e0fcf7bb1ff3e19272687
https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745r

Comment 1 Avinash Hanwate 2022-07-14 05:18:59 UTC
Created python-ujson tracking bugs for this issue:

Affects: epel-all [bug 2106992]
Affects: fedora-all [bug 2106990]
Affects: openstack-rdo [bug 2106993]

Comment 3 errata-xmlrpc 2022-12-07 19:25:33 UTC
This issue has been addressed in the following products:

  Red Hat OpenStack Platform 16.2

Via RHSA-2022:8850 https://access.redhat.com/errata/RHSA-2022:8850

Comment 4 errata-xmlrpc 2022-12-07 20:26:53 UTC
This issue has been addressed in the following products:

  Red Hat OpenStack Platform 16.1

Via RHSA-2022:8864 https://access.redhat.com/errata/RHSA-2022:8864

Comment 5 Product Security DevOps Team 2022-12-10 01:33:00 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-31116