Executive brief
A vulnerability in Python's standard library could allow attackers to bypass security checks when handling web cookies. By injecting special control characters into cookie data, an attacker might be able to manipulate how a web browser or server processes session information. This could lead to unauthorized changes in application behavior or security bypasses in web-based services.
Technical details
This vulnerability is an incomplete fix for a previous issue (CVE-2026-0672) regarding control character validation in the http.cookies.Morsel class. While some paths were previously secured, the Morsel.update() method, the |= operator, and unpickling routines remained unpatched, allowing control characters to bypass input validation. Furthermore, BaseCookie.js_output() lacked the output validation present in BaseCookie.output(). An attacker can exploit this by providing specially crafted cookie data that includes control characters, which could be used to perform cookie injection attacks. Patches have been released for affected CPython branches including 3.13 and 3.14.
Affected products
- Python Software Foundation Python (CPython) < 3.13.13, 3.14.0 - 3.14.4, 3.15.0a1 - 3.15.0a7
Timeline
- 2026-03-06: other: Issue reported and initial PRs created
- 2026-03-16: disclosed: Vulnerability disclosed and CVE assigned
- 2026-03-16: patched: Fixes merged into main CPython branches
- 2026-03-16: advisory: Security announcement sent to python-announce mailing list
References
- https://github.com/python/cpython/commit/57e88c1cf95e1481b94ae57abe1010469d47a6b4
- https://github.com/python/cpython/commit/62ceb396fcbe69da1ded3702de586f4072b590dd
- https://github.com/python/cpython/commit/d16ecc6c3626f0e2cc8f08c309c83934e8a979dd
- https://github.com/python/cpython/issues/145599
- https://github.com/python/cpython/pull/145600
- https://mail.python.org/archives/list/security-announce@python.org/thread/H6CADMBCDRFGWCMOXWUIHFJNV43GABJ7/