Description
When folding a long comment in an email header containing exclusively unfoldable characters, the parenthesis would not be preserved. This could be used for injecting headers into email messages where addresses are user-controlled and not sanitized.
Product status
Any version before 3.13.12
3.14.0 (python) before 3.14.3
3.15.0a1 (python) before 3.15.0a6
Credits
Denis Ledoux
Seth Larson
Denis Ledoux
R. David Murray
References
github.com/python/cpython/pull/143936
github.com/python/cpython/issues/143935
mail.python.org/.../thread/FELSEOLBI2QR6YLG6Q7VYF7FWSGQTKLI/
github.com/...ommit/17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2
github.com/...ommit/61614a5e5056e4f61ced65008d4576f3df34acb6
github.com/...ommit/e9970f077240c7c670e8a6fc6662f2b30d3b6ad0
github.com/...ommit/f738386838021c762efea6c9802c82de65e87796
github.com/...ommit/a76e4cd62dd68e7cbe86e37e6ed988495a646b66