CVE-2026-1299: Python Software Foundation CPython · CWE-93
Affects Python Software Foundation CPythonSource CVE Database V5
Not known to be exploited · CVSS 6.0 Medium · fixed in 3.15.0a6 : update Python Software Foundation CPython when convenient.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 47% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 3.15.0a6, 3.14.3, 3.13.12 +3
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 23 Jan 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Upgrade to a fixed release listed under Affected software.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Python Software FoundationCPython | Affected
| Fixed in
|
GitHubpython/cpythonpkg:github/python/cpythonOther threats | Affected
| Fixed in– |
GitHubCPythonpkg:github/CPythonOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
To mitigate CVE-2026-1299, organizations should: 1) Upgrade to the latest patched versions of CPython beyond 3.15.0a1 once available, as the Python Software Foundation has implemented stricter header validation in the BytesGenerator class. 2) Review and sanitize all email headers generated or processed by applications using the email module, especially those using LiteralHeader objects, ensuring compliance with email folding and formatting standards. 3) Implement input validation and sanitization on any user-supplied data that may be included in email headers to prevent injection of malicious content. 4) Employ defense-in-depth by using email security gateways and filters that detect and block malformed or suspicious email headers. 5) Monitor logs for unusual email header patterns or serialization errors that may indicate exploitation attempts. 6) Educate developers on secure email handling practices and the risks of improper header serialization. 7) If upgrading is not immediately possible, consider patching or applying workarounds that reject or sanitize improperly folded headers at the application level.
Description
The email module, specifically the "BytesGenerator" class, didn’t properly quote newlines for email headers when serializing an email message allowing for header injection when an email is serialized. This is only applicable if using "LiteralHeader" writing headers that don't respect email folding rules, the new behavior will reject the incorrectly folded headers in "BytesGenerator".
References
- github.com/python/cpython/pull/144126 (opens in a new tab)
- github.com/python/cpython/issues/144125 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2024-6923 (opens in a new tab)
- mail.python.org/archives/list/security-announce@python.org/thread/6ZZULGALJTITEAGEXLDJE2C6FORDXPBT/ (opens in a new tab)
- github.com/python/cpython/commit/052e55e7d44718fe46cbba0ca995cb8fcc359413 (opens in a new tab)
- github.com/python/cpython/commit/0a925ab591c45d6638f37b5e57796f36fa0e56d8 (opens in a new tab)
- github.com/python/cpython/commit/7877fe424415bc4a13045e62a90a7277413d8cb9 (opens in a new tab)
- github.com/python/cpython/commit/842ce19a0c0b58d61591e8f6a708c38db1fb94e4 (opens in a new tab)
- github.com/python/cpython/commit/8cdf6204f4ae821f32993f8fc6bad0d318f95f36 (opens in a new tab)
- github.com/python/cpython/commit/e417f05ad77a4c30ddc07f99e90fc0cef43e831a (opens in a new tab)