You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
email.utils.parseaddr(strict=True) silently splices inline comments in the local-part #159475
email.utils.parseaddr() and getaddresses(), even in strict=True mode (the default since the CVE-2023-27043 fix), silently drop a comment that is embedded inside a dot-atom and splice the surrounding atoms together:
So a caller that validates or authorizes with parseaddr and then hands the original string to a strict component gets a subject mismatch — the same class as CVE-2019-11340 and the motivation for CVE-2023-27043.
Proposal: in strict mode, fail closed (return ('', '')) when a comment is embedded inside a dot-atom instead of splicing. strict=False would keep the historical lenient behavior. I'm happy to prepare a PR.
Activity
pythongh-159475: Make parseaddr() reject inline comments in strict mode
pythongh-159475: Make parseaddr() reject inline comments in strict mode