CPython: Incorrect Calculation
CVE-2025-4435 is a high-severity incorrect calculation 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.9.23, 3.10.18, 3.11.13 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 0.62% chance of exploitation within 30 days, higher than 50% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update CPython to 3.9.23 or 3.10.18 or 3.11.13 or 3.12.11, 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.9.23; 3.10.0 up to, but not including, 3.10.18; 3.11.0 up to, but not including, 3.11.13; 3.12.0 up to, but not including, 3.12.11; 3.13.0 up to, but not including, 3.13.4; 3.14.0a1 up to, but not including, 3.14.0b3 | 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, 3.14.0b3 |
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
- HighData or code can be modified at will.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N. Scored by CNA (python.org).
Official description
When using a TarFile.errorlevel = 0 and extracting with a filter the documented behavior is that any filtered members would be skipped and not extracted. However the actual behavior of TarFile.errorlevel = 0 in affected versions is that the member would still be extracted and not skipped.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Incorrect Calculation
The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management.
How developers prevent this class of flaw
- Understand your programming language's underlying representation and how it interacts with numeric calculation. Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, not-a-number calculations, and how your language handles numbers that are too large or too small for its underlying representation.
- Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
- Use the appropriate type for the desired action. For example, in C/C++, only use unsigned types for values that could never be negative, such as height, width, or other numbers related to quantity.
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/19de092debb3d7e832e5672cc2f7b788d35951da
- github.com/python/cpython/commit/28463dba112af719df1e8b0391c46787ad756dd9
- github.com/python/cpython/commit/3612d8f51741b11f36f8fb0494d79086bac9390a
- github.com/python/cpython/commit/4633f3f497b1ff70e4a35b6fe2c907cbe2d4cb2e
- github.com/python/cpython/commit/9c1110ef6652687d7c55f590f909720eddde965a
- github.com/python/cpython/commit/9e0ac76d96cf80b49055f6d6b9a6763fb9215c2a
- github.com/python/cpython/commit/aa9eb5f757ceff461e6e996f12c89e5d9b583b01
- github.com/python/cpython/commit/dd8f187d0746da151e0025c51680979ac5b4cfb1
- github.com/python/cpython/pull/135037
Other references
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 Calculation vulnerabilities
- 7.5 High severity
- 8.8 High severity
- 7.8 High severity
- 7.8 High severity
- 9.8 Critical severity
- 7.5 High severity
Spotted an error? Tell us.