CVE-2026-1299
JSON

6.0medium

email BytesGenerator header injection due to unquoted newlines

Severity
6.0medium CVSS:4.0 by PSF
Exploit likelihood
0.57% (higher than 48% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
PSF
Also known as
PSF-2026-8BIT-LIBPYTHON-2026-1299BIT-PYTHON-2026-1299BIT-PYTHON-MIN-2026-1299

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

Affected

Product or packageVersionsReported by
Python Software Foundation CPythonbefore 3.10.20, from 3.11.0 before 3.11.15, from 3.12.0 before 3.12.13, from 3.13.0 before 3.13.12, from 3.14.0 before 3.14.3, from 3.15.0a1 before 3.15.0a6CVE List
https://github.com/python/cpythonbefore 052e55e7d44718fe46cbba0ca995cb8fcc359413, before 0a925ab591c45d6638f37b5e57796f36fa0e56d8, before 7877fe424415bc4a13045e62a90a7277413d8cb9, before 842ce19a0c0b58d61591e8f6a708c38db1fb94e4, before 8cdf6204f4ae821f32993f8fc6bad0d318f95f36, before e417f05ad77a4c30ddc07f99e90fc0cef43e831aPython Software Foundation
libpython (Bitnami)before 3.10.20, from 3.11.0 before 3.11.15, from 3.12.0 before 3.12.13, from 3.13.0 before 3.13.12, from 3.14.0 before 3.14.3Bitnami Vulnerability Database
python (Bitnami)before 3.10.20, from 3.11.0 before 3.11.15, from 3.12.0 before 3.12.13, from 3.13.0 before 3.13.12, from 3.14.0 before 3.14.3Bitnami Vulnerability Database
python-min (Bitnami)before 3.10.20, from 3.11.0 before 3.11.15, from 3.12.0 before 3.12.13, from 3.13.0 before 3.13.12, from 3.14.0 before 3.14.3Bitnami Vulnerability Database

All scores

PSF6.0medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-93

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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

NVD (es)

El módulo de correo electrónico, específicamente la clase 'BytesGenerator', no escapaba correctamente los saltos de línea para los encabezados de correo electrónico al serializar un mensaje de correo electrónico, lo que permitía la inyección de encabezados cuando se serializa un correo electrónico. Esto solo es aplicable si se utiliza 'LiteralHeader' para escribir encabezados que no respetan las reglas de plegado de correo electrónico; el nuevo comportamiento rechazará los encabezados plegados incorrectamente en 'BytesGenerator'.

References

https://github.com/python/cpython/pull/144126patch, web
https://github.com/python/cpython/issues/144125issue-tracking, report, web
https://cve.org/CVERecord?id=CVE-2024-6923related, web
https://mail.python.org/archives/list/security-announce@python.org/thread/6ZZULGALJTITEAGEXLDJE2C6FORDXPBT/advisory, vendor-advisory, web
https://github.com/python/cpython/commit/052e55e7d44718fe46cbba0ca995cb8fcc359413fix, patch, web
https://github.com/python/cpython/commit/0a925ab591c45d6638f37b5e57796f36fa0e56d8fix, patch, web
https://github.com/python/cpython/commit/7877fe424415bc4a13045e62a90a7277413d8cb9fix, patch, web
https://github.com/python/cpython/commit/842ce19a0c0b58d61591e8f6a708c38db1fb94e4fix, patch, web
https://github.com/python/cpython/commit/8cdf6204f4ae821f32993f8fc6bad0d318f95f36fix, patch, web
https://github.com/python/cpython/commit/e417f05ad77a4c30ddc07f99e90fc0cef43e831afix, patch, web
https://nvd.nist.gov/vuln/detail/CVE-2026-1299web

Sources

SourceRecordLicence
CVE ListCVE-2026-1299 changed 2026-03-03CVE Terms of Use
Python Software FoundationPSF-2026-8 changed 2026-02-14CC-BY-4.0
NVDCVE-2026-1299 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-LIBPYTHON-2026-1299 changed 2026-04-10Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-2026-1299 changed 2026-04-10Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-MIN-2026-1299 changed 2026-04-10Apache-2.0