Skip to content
OpenAdvisories
High · 7.5 CVE-2022-31116 EUVD-2022-6438GHSA-wpqr-jcpx-745rPYSEC-2026-1057

Incorrect handling of invalid surrogate pair characters in ujson

Published Jul 5, 2022 · Updated Apr 22, 2025 · Assigned by GitHub_M

Description

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.

Affected products

VendorProductAffectedFixed
ultrajson ultrajson < 5.4.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 ujson 5.4.0-1 —
Debian 13 ujson 5.4.0-1 —
Debian 12 ujson 5.4.0-1 —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 pandas No fix yet —
Ubuntu 26.04 LTS pandas No fix yet —
Ubuntu 25.10 pandas No fix yet —
Ubuntu 24.04 LTS pandas No fix yet —
Ubuntu 22.04 LTS pandas +1 No fix yet —
Show 8 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS pandas No fix yet —
Ubuntu 18.04 LTS pandas +1 No fix yet —
Ubuntu 16.04 LTS pandas +1 No fix yet —
Ubuntu 14.04 LTS pandas No fix yet —
Ubuntu Pro 22.04 LTS ujson 5.1.0-1ubuntu0.1~esm1 USN-6629-1
Ubuntu Pro 20.04 LTS ujson 1.35-4ubuntu0.1+esm1 USN-6629-3
Ubuntu Pro 18.04 LTS ujson 1.35-2ubuntu0.1~esm1 USN-6629-1
Ubuntu Pro 16.04 LTS ujson 1.33-1ubuntu0.1~esm2 USN-6629-1
ReleasePackageFixed inAdvisory
Red Hat OpenStack 16 python-ujson +1 2.0.3-3.el8ost RHSA-2022:8864, RHSA-2022:8850
ReleasePackageFixed inAdvisory
SLES 15 SP4 python-ujson 1.35-150100.3.5.1 SUSE-SU-2022:2673-1
SLES 15 SP3 python-ujson 1.35-150100.3.5.1 SUSE-SU-2022:2673-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-ujson 5.10.0-1.5 openSUSE-SU-2025:15107-1
openSUSE Leap 15.4 python-ujson 1.35-150100.3.5.1 SUSE-SU-2022:2673-1
openSUSE Leap 15.3 python-ujson 1.35-150100.3.5.1 SUSE-SU-2022:2673-1
ReleasePackageFixed inAdvisory
Alpine v3.24 py3-ujson 5.4.0-r0 —
Alpine v3.23 py3-ujson 5.4.0-r0 —
Alpine v3.22 py3-ujson 5.4.0-r0 —
Alpine v3.21 py3-ujson 5.4.0-r0 —
Alpine v3.20 py3-ujson 5.4.0-r0 —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 py3-ujson 5.4.0-r0 —
Alpine v3.18 py3-ujson 5.4.0-r0 —
Alpine v3.17 py3-ujson 5.4.0-r0 —
Alpine v3.16 py3-ujson 5.4.0-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI ujson < 5.4.0 5.4.0 GHSA-wpqr-jcpx-745r

Advisories 7

References