What’s Vulnerable › Vulnerabilities

CVE-2026-1299: email BytesGenerator header injection due to unquoted newlines

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 products

How to fix

Upgrade to a fixed version: Python 3.10.20, 3.11.15, 3.12.13, 3.13.12. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-1299 or the next vulnerability affects your stack