Python: Deserialization of Untrusted Data
CVE-2022-42919 is a high-severity deserialization of untrusted data vulnerability in Python, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 3.9.16, 3.10.9 as the first without the flaw, so updating Python to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.8% chance of exploitation within 30 days, higher than 57% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Python to 3.9.16 or 3.10.9, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Python | Python | 3.7.3 through 3.7.15; 3.8.3 through 3.8.15; 3.9.0 up to, but not including, 3.9.16; 3.10.0 up to, but not including, 3.10.9 | 3.9.16, 3.10.9 |
| Fedora Project | Fedora | 35; 36; 37 | Not stated |
Version data comes from NVD's product matching. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.8 | High | NVD |
| CVSS 3.1 | 7.8 | High | CISA (ADP) |
Official description
Python 3.9.x before 3.9.16 and 3.10.x before 3.10.9 on Linux allows local privilege escalation in a non-default configuration. The Python multiprocessing library, when used with the forkserver start method on Linux, allows pickles to be deserialized from any user in the same machine local network namespace, which in many system configurations means any user on the same machine. Pickles can execute arbitrary code. Thus, this allows for local user privilege escalation to the user that any forkserver process is running as. Setting multiprocessing.util.abstract_sockets_supported to False is a workaround. The forkserver start method for multiprocessing is not the default start method. This issue is Linux specific because only Linux supports abstract namespace sockets. CPython before 3.9 does not make use of Linux abstract namespace sockets by default. Support for users manually specifying an abstract namespace socket was added as a bugfix in 3.7.8 and 3.8.3, but users would need to make specific uncommon API calls in order to do that in CPython before 3.9.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
How developers prevent this class of flaw
- If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
- Explicitly define a final object() to prevent deserialization.
More Deserialization of Untrusted Data vulnerabilities (CWE-502)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/python/cpython/compare/v3.10.8...v3.10.9Release Notes
- github.com/python/cpython/compare/v3.9.15...v3.9.16Release Notes
Third-party and government advisories
- github.com/python/cpython/issues/97514Third Party Advisory
- github.com/python/cpython/issues/97514#issuecomment-1310277840Third Party Advisory
- security.netapp.com/advisory/ntap-20221209-0006/Third Party Advisory
Other references
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FKGCQPIVHEAIJ77R3RSN…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/P2LHWWEI5OBQ6RELULMV…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PI5DYIED6U26BGX5IRZW…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QLUGZSEAO3MBWGKCUSMK…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R6KGIRHSENZ4QAB234Z3…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RDK3ZZBRYFO47ET3N4BN…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VCRKBB5Y5EWTJUNC7LK6…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XX6LLAXGZVZ327REY6MD…
- security.gentoo.org/glsa/202305-02
- lists.debian.org/debian-lts-announce/2024/12/msg00000.html
Other vulnerabilities in Python
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Recent Deserialization of Untrusted Data vulnerabilities
- 8.8 High severity
- 9.8 Critical severity
- 9.8 Critical severity
- 9.8 Critical severity
- 9.8 Critical severity
- 7.2 High severity
Spotted an error? Tell us.