CPython: Incorrect Comparison
CVE-2024-4032 is a high-severity incorrect comparison vulnerability in CPython from Python Software Foundation, 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. The record lists versions 3.8.20, 3.9.20, 3.10.15 as the first without the flaw, so updating CPython to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.08% chance of exploitation within 30 days, higher than 66% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update CPython to 3.8.20 or 3.9.20 or 3.10.15 or 3.11.10, whichever matches your release line, or a later version.
- Update cpython to 3.12.4 or 3.13.0a6, whichever matches your release line, or a later version.
- 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 |
|---|---|---|---|
| Python Software Foundation | CPython | before 3.8.20; 3.9.0 up to, but not including, 3.9.20; 3.10.0 up to, but not including, 3.10.15; 3.11.0 up to, but not including, 3.11.10; 3.12.0 up to, but not including, 3.12.4; 3.13.0a1 up to, but not including, 3.13.0a6 | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4, 3.13.0a6 |
| Python | cpython | before 3.12.4; 3.13.0a1 up to, but not including, 3.13.0a6 | 3.12.4, 3.13.0a6 |
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
- HighAll data handled by the component can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Scored by CISA (ADP).
Official description
The “ipaddress” module contained incorrect information about whether certain IPv4 and IPv6 addresses were designated as “globally reachable” or “private”. This affected the is_private and is_global properties of the ipaddress.IPv4Address, ipaddress.IPv4Network, ipaddress.IPv6Address, and ipaddress.IPv6Network classes, where values wouldn’t be returned in accordance with the latest information from the IANA Special-Purpose Address Registries. CPython 3.12.4 and 3.13.0a6 contain updated information from these registries and thus have the intended behavior.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Incorrect Comparison
The product compares two entities in a security-relevant context, but the comparison is incorrect.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/python/cpython/commit/22adf29da8d99933ffed8647d3e0726edd16f7f8
- github.com/python/cpython/commit/40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f
- github.com/python/cpython/commit/895f7e2ac23eff4743143beef0f0c5ac71ea27d3
- github.com/python/cpython/commit/ba431579efdcbaed7a96f2ac4ea0775879a332fb
- github.com/python/cpython/commit/c62c9e518b784fe44432a3f4fc265fb95b651906
- github.com/python/cpython/commit/f86b17ac511e68192ba71f27e752321a3252cee3
- github.com/python/cpython/pull/113179
Other references
- openwall.com/lists/oss-security/2024/06/17/3
- github.com/python/cpython/issues/113171
- mail.python.org/archives/list/[email protected]/thread/NRUHDUS2IV2USIZM2CVMSFL6SCKU3RZA/
- security.netapp.com/advisory/ntap-20240726-0004/
- iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
- iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
- lists.debian.org/debian-lts-announce/2024/12/msg00000.html
Other vulnerabilities in CPython
- 8.2 High severity
- 9.4 Critical severity
- 7.6 High severity
- 9.2 Critical severity
- 8.4 High severity
- 7.5 High severity
Recent Incorrect Comparison vulnerabilities
- 9.1 Critical severity
- 9.8 Critical severity
- 9.8 Critical severity
- 8.8 High severity
- 7.2 High severity
- 7.2 High severity
Spotted an error? Tell us.