CVE-2026-1299

email BytesGenerator header injection due to unquoted newlines

Published Jan 23, 2026 CVSS 4.0 · 6 Medium EPSS < 1% KEV · Not listed
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".

Analysis

AI-generated

Technical impact

The BytesGenerator class in CPython’s email module failed to quote newline characters in headers during serialization, enabling an attacker who can influence header data to inject arbitrary email headers. The flaw manifests when using the LiteralHeader writer, which does not enforce email folding rules. Successful exploitation could lead to email spoofing, content corruption, or delivery of malicious content to recipients.

Affected Systems

All CPython installations that employ the email module’s BytesGenerator with the LiteralHeader writer are vulnerable. The exact version range is not specified, so any build prior to the commit that introduced the fix should be considered affected.

Risk and Exploitability

The CVSS score of six reflects a moderate severity, while the EPSS probability of less than one percent indicates low likelihood of widespread exploitation. The vulnerability is not present in the CISA KEV list, suggesting it has not been observed in the wild. Likely attack vectors involve applications that construct and send email messages using untrusted header input, giving an attacker the capacity to manipulate header fields. The absence of a KEV listing reduces urgency, but the nature of header injection remains a valid concern for message integrity.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade CPython to a version that incorporates the patch committed on 052e55e7- ... to ensure correct quotation of newlines in email headers.
  • If upgrading is not immediately feasible, modify application code to avoid using LiteralHeader for any data that can be influenced by users, and instead use the Header class or explicitly escape newline characters before passing them to.BytesGenerator.
  • Configure or harden the email module to reject incorrectly folded headers, or wrap the header generation logic with validation that enforces email folding rules and rejects unquoted newline characters.

Generated by OpenCVE AI on April 16, 2026 at 17:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4455-1 python3.9 security update
Ubuntu USN Ubuntu USN USN-8509-1 Python vulnerabilities
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Python
Python cpython
Vendors & Products Python
Python cpython
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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".
Title email BytesGenerator header injection due to unquoted newlines
Weaknesses CWE-93
References
Metrics cvssV4_0

{'score': 6, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Mar 3, 2026, 2:43 PM
Reserved
Jan 21, 2026, 6:30 PM
Status
Deferred
Published
Jan 23, 2026, 5:16 PM
Modified
Jun 17, 2026, 10:15 AM
Severity
Moderate
Public date
Jan 23, 2026, 4:27 PM