ultrajson: Always-Incorrect Control Flow Implementation
CVE-2022-31116 is a high-severity always-incorrect control flow implementation vulnerability in ultrajson, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected ultrajson versions: < 5.4.0. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 2.54% chance of exploitation within 30 days, higher than 85% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of ultrajson you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Ultrajson | ultrajson | < 5.4.0 | Not stated |
| Fedora Project | Fedora | 35; 36 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- NoneNo data is disclosed.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.5 | High | CNA (github.com) |
| CVSS 3.1 | 7.5 | High | NVD |
| CVSS 2.0 | 5.0 | Medium | NVD |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Always-Incorrect Control Flow Implementation
The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.
More Always-Incorrect Control Flow Implementation vulnerabilities (CWE-670)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745rExploit, Third Party Advisory
Patches and release notes
- github.com/ultrajson/ultrajson/commit/67ec07183342589d602e0fcf7bb1ff3e19272687Third Party Advisory
Other references
Other vulnerabilities in ultrajson
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Recent Always-Incorrect Control Flow Implementation vulnerabilities
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 9.8 Critical severity
Spotted an error? Tell us.