BIT-libpython-2026-0672: Header injection in http.cookies.Morsel
When using http.cookies.Morsel, user-controlled cookie values and parameters can allow injecting HTTP headers into messages. Patch rejects all control characters within cookie names, values, and parameters.
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed?
Applications are exposed when they use http.cookies.Morsel with cookie names, values, or parameters that can be influenced by a user. Code that does not pass user-controlled data into Morsel is not identified as affected by the available information.
What does an attacker need to exploit this issue?
An attacker needs a way to supply crafted cookie-related input to vulnerable Morsel usage. The supplied metadata indicates network reachability, low privileges, no user interaction, and that additional attack conditions are required.
What can be done before applying the patch?
Ensure cookie names, values, and parameters passed to Morsel reject control characters. The patch addresses the issue by rejecting all control characters in those fields.
How can I identify potentially affected code?
Review uses of http.cookies.Morsel and trace whether cookie names, values, or parameters originate from requests or other user-controlled sources. Inputs containing control characters are the relevant indicator for this issue.