UltraJSON: Multiple Vulnerabilities — GLSA 202403-03

Multiple vulnerabilities have been discovered in UltraJSON, the worst of which could lead to key confusion and value overwriting.

Affected packages

dev-python/ujson on all architectures
Affected versions < 5.4.0
Unaffected versions >= 5.4.0

Background

UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.8+.

Description

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.

Impact

Please review the referenced CVE identifiers for details.

Workaround

There is no known workaround at this time.

Resolution

All UltraJSON users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --oneshot --verbose ">=dev-python/ujson-5.4.0"
 

References

Release date
March 03, 2024

Latest revision
March 03, 2024: 1

Severity
normal

Exploitable
remote

Bugzilla entries