PSF-2026-8: email BytesGenerator header injection due to unquoted newlines

Published Jan 23, 2026
·
Updated

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 Software

1 affected component
Python Software Foundation Python email module

Event History

Jan 23, 2026
CVE Published
via OSV·04:27 PM
Data Sourced
via OSV·04:27 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications are affected only if they use the Python email module's BytesGenerator to serialize messages and use LiteralHeader to write headers that do not comply with email folding rules.

2

What must an attacker be able to control?

An attacker would need to cause improperly folded header content containing unquoted newlines to be serialized through BytesGenerator. The resulting serialization can allow header injection.

3

Are normal email header-writing workflows affected?

The issue is described as applicable only to LiteralHeader usage for headers that do not respect email folding rules. The updated BytesGenerator behavior rejects those incorrectly folded headers.

4

What mitigation is available if an update cannot be applied immediately?

Avoid using LiteralHeader for headers that do not follow email folding rules, and ensure header values do not contain improperly folded or unquoted newlines before serializing messages with BytesGenerator.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203