Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-1299: CWE-93 in Python Software Foundation CPython

0
Medium
VulnerabilityCVE-2026-1299cvecve-2026-1299cwe-93
Published: Fri Jan 23 2026 (01/23/2026, 16:27:13 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: CPython

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".

AI-Powered Analysis

AILast updated: 01/31/2026, 09:03:09 UTC

Technical Analysis

CVE-2026-1299 is a vulnerability identified in the Python Software Foundation's CPython implementation, specifically within the email module's BytesGenerator class. The flaw arises because the BytesGenerator does not properly quote newline characters when serializing email headers, particularly when headers are created using the LiteralHeader class, which bypasses standard email folding rules. Email folding is a mechanism to split long header lines into multiple lines for compliance with email standards. Improper handling of these newlines can allow an attacker to inject additional headers or manipulate existing ones during serialization, a classic header injection attack (CWE-93). This can lead to various malicious outcomes such as email spoofing, phishing, or bypassing email security controls. The vulnerability requires low attack complexity and privileges (PR:L), with no user interaction needed, but some authentication is required. The CVSS 4.0 vector indicates network attack vector (AV:N), low attack complexity (AC:L), partial attack complexity (AT:P), low confidentiality impact (VC:L), high integrity impact (VI:H), and no availability impact. The vulnerability is currently published with no known exploits in the wild and no patches linked yet. This issue primarily affects Python environments that serialize email messages using the email module, which is widely used in automated email systems, web applications, and backend services. The new behavior in BytesGenerator will reject incorrectly folded headers, but legacy or improper usage of LiteralHeader can still be exploited. Organizations using Python for email processing should audit their code for use of LiteralHeader and ensure proper header folding and sanitization.

Potential Impact

For European organizations, the impact of CVE-2026-1299 can be significant in sectors relying heavily on automated email generation and processing, such as finance, healthcare, government, and telecommunications. Exploitation could allow attackers to inject malicious headers into emails, facilitating phishing campaigns, email spoofing, or evasion of email security gateways. This can lead to data breaches, reputational damage, and regulatory non-compliance under GDPR if sensitive information is exposed or manipulated. The integrity of email communications could be compromised, undermining trust in organizational communications. Since Python is widely used in European IT infrastructures, especially in startups, research institutions, and enterprises, the scope is broad. Although the vulnerability does not directly affect availability, the potential for integrity compromise and confidentiality leakage through phishing or social engineering attacks is notable. Organizations with automated email workflows or custom email handling scripts are particularly at risk. The lack of known exploits currently reduces immediate risk but does not preclude future exploitation.

Mitigation Recommendations

European organizations should immediately audit their Python codebases for usage of the email module, specifically the BytesGenerator class and LiteralHeader usage. Avoid using LiteralHeader for untrusted input or ensure strict validation and sanitization of header values to prevent injection of newline characters. Implement input validation to reject or escape newline and carriage return characters in email headers. Monitor Python Software Foundation announcements for official patches or updates addressing this vulnerability and apply them promptly once available. Consider using alternative libraries or updated email serialization methods that enforce proper header folding and quoting. Employ email security gateways with robust header anomaly detection to catch suspicious header injections. Conduct security awareness training to recognize phishing attempts that may exploit this vulnerability. For critical systems, implement additional logging and alerting on email generation anomalies. Finally, review and update incident response plans to include scenarios involving email header injection attacks.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
PSF
Date Reserved
2026-01-21T18:30:52.594Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6973a6f24623b1157c4f2e0b

Added to database: 1/23/2026, 4:50:58 PM

Last enriched: 1/31/2026, 9:03:09 AM

Last updated: 2/7/2026, 12:33:34 PM

Views: 314

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats