CPython: Uncontrolled Recursion
CVE-2026-4224 is a high-severity uncontrolled recursion 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.10.21, 3.11.16, 3.12.14 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.77% chance of exploitation within 30 days, higher than 56% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update CPython to 3.10.21 or 3.11.16 or 3.12.14 or 3.13.13, whichever matches your release line, or a later version.
- Update Python to 3.10.0 or 3.13.13 or 3.14.4, 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.10.21; 3.11.0 up to, but not including, 3.11.16; 3.12.0 up to, but not including, 3.12.14; 3.13.0 up to, but not including, 3.13.13; 3.14.0 up to, but not including, 3.14.4; 3.15.0a1 up to, but not including, 3.15.0a8 | 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4, 3.15.0a8 |
| Python | Python | before 3.10.0; 3.13.0 up to, but not including, 3.13.13; 3.14.0 up to, but not including, 3.14.4; 3.15.0 | 3.10.0, 3.13.13, 3.14.4 |
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 4.0 | 6.0 | Medium | CNA (python.org) |
| CVSS 3.1 | 7.5 | High | NVD |
Official description
When an Expat parser with a registered ElementDeclHandler parses an inline document type definition containing a deeply nested content model a C stack overflow occurs.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Uncontrolled Recursion
The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.
How developers prevent this class of flaw
- Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/python/cpython/commit/196edfb06a7458377d4d0f4b3cd41724c1f3bd4a
- github.com/python/cpython/commit/24ce88b285f56ee11626cf5e472af3cd8cc7c621
- github.com/python/cpython/commit/642865ddf4b232da1f3b1f7abcfa3254c4bfe785
- github.com/python/cpython/commit/af856a7177326ac25d9f66cc6dd28b554d914fee
- github.com/python/cpython/commit/e0a8a6da90597a924b300debe045cdb4628ee1f3
- github.com/python/cpython/commit/eb0e8be3a7e11b87d198a2c3af1ed0eccf532768
- github.com/python/cpython/pull/145987
Third-party and government advisories
- mail.python.org/archives/list/[email protected]/thread/5M7CGUW3XBRY7II4DK43KF7NQQ3TPZ6R/Third Party Advisory
- openwall.com/lists/oss-security/2026/03/16/4Mailing List, Third Party Advisory
Other references
- github.com/python/cpython/issues/145986Issue Tracking
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 Uncontrolled Recursion vulnerabilities
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.