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".
Published: 2026-01-23
Score: 6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Header Injection
Action: Apply Patch
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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
History

Fri, 13 Feb 2026 16:30:00 +0000


Thu, 29 Jan 2026 00:15:00 +0000

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


Mon, 26 Jan 2026 14:45:00 +0000


Mon, 26 Jan 2026 12:00:00 +0000

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

Fri, 23 Jan 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 23 Jan 2026 16:45:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: PSF

Published:

Updated: 2026-03-03T14:43:35.655Z

Reserved: 2026-01-21T18:30:52.594Z

Link: CVE-2026-1299

cve-icon Vulnrichment

Updated: 2026-01-23T16:56:16.248Z

cve-icon NVD

Status : Deferred

Published: 2026-01-23T17:16:12.977

Modified: 2026-04-15T00:35:42.020

Link: CVE-2026-1299

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-01-23T16:27:13Z

Links: CVE-2026-1299 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-16T17:45:27Z

Weaknesses