# CVE-2022-31116: PYSEC-2026-1057 - Incorrect handling of invalid surrogate pair characters

Source: https://junglewise.ai/threats/cve-2022-31116-incorrect-handling-of-invalid-surrogate-pair-characters  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-06  
License: CC BY 4.0 with a link back

CVE-2022-31116 · Severity: low · CVSS 3.1 · Published 2026-07-06

Incorrect handling of invalid surrogate pair characters

Technologies: [ujson (PyPI)](https://junglewise.ai/threats/technologies/ujson). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2022-31116 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-31116 being exploited in the wild.

**How severe is CVE-2022-31116?** Low severity, with a CVSS score of 3.1, published 6 July 2026.

**Which products and versions are affected?** ujson (PyPI) ECOSYSTEM:introduced=0,fixed=5.4.0.

**Is there a fix for CVE-2022-31116?** Yes. ujson (PyPI): upgrade to 5.4.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2022-31116?** Check whether you run ujson (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- ujson (PyPI): upgrade to 5.4.0 or later

  ```sh
  pip install "ujson>=5.4.0"
  ```


## Affected products

- ujson (PyPI) ECOSYSTEM:introduced=0,fixed=5.4.0

## Identifiers

- CVE-2022-31116
- GHSA-wpqr-jcpx-745r
- PYSEC-2026-1057

## Related threats

- [PYSEC-2026-1056 - Potential double free of buffer during string decoding](https://junglewise.ai/threats/cve-2022-31117-potential-double-free-of-buffer-during-string-decoding)
- [UltraJSON improper input validation in ujson.dumps UTF-8 handling](https://junglewise.ai/threats/cve-2026-54911-ultrajson-improper-input-validation-in-ujson-dumps-utf-8-handling)
- [UltraJSON memory leak in ujson.dump on write failure](https://junglewise.ai/threats/cve-2026-44660-ultrajson-memory-leak-in-ujson-dump-on-write-failure)
- [UltraJSON integer overflow in indent handling](https://junglewise.ai/threats/cve-2026-32875-ultrajson-integer-overflow-in-indent-handling)
- [UltraJSON memory leak in JSON parsing of large integers](https://junglewise.ai/threats/cve-2026-32874-ultrajson-memory-leak-in-json-parsing-of-large-integers)
