CVE-2023-23934: Wrkzeug's incorrect parsing of nameless cookies leads to __Host- cookies bypass
Browsers may allow "nameless" cookies that look like =value instead of key=value. A vulnerable browser may allow a compromised application on an adjacent subdomain to exploit this to set a cookie like =Host-test=bad for another subdomain.
Werkzeug <= 2.2.2 will parse the cookie =Host-test=bad as Host-test=bad. If a Werkzeug application is running next to a vulnerable or malicious subdomain which sets such a cookie using a vulnerable browser, the Werkzeug application will see the bad cookie value but the valid cookie key.
Other sources
Browsers may allow "nameless" cookies that look like =value instead of key=value. A vulnerable browser may allow a compromised application on an adjacent subdomain to exploit this to set a cookie like =Host-test=bad for another subdomain.
Werkzeug <= 2.2.2 will parse the cookie =Host-test=bad as Host-test=bad. If a Werkzeug application is running next to a vulnerable or malicious subdomain which sets such a cookie using a vulnerable browser, the Werkzeug application will see the bad cookie value but the valid cookie key.
— Red Hat
Pallets Werkzeug could allow a remote attacker to bypass security restrictions, caused by improper input validation. By sending a specially-crafted request, an attacker could exploit this vulnerability to set a cookie like =Host-test=bad for another subdomain.
— IBM
Werkzeug is a comprehensive WSGI web application library. Browsers may allow "nameless" cookies that look like =value instead of key=value. A vulnerable browser may allow a compromised application on an adjacent subdomain to exploit this to set a cookie like =Host-test=bad for another subdomain. Werkzeug prior to 2.2.3 will parse the cookie =Host-test=bad as Host-test=bad. If a Werkzeug application is running next to a vulnerable or malicious subdomain which sets such a cookie using a vulnerable browser, the Werkzeug application will see the bad cookie value but the valid cookie key. The issue is fixed in Werkzeug 2.2.3.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is CVE-2023-23934?
CVE-2023-23934 is a vulnerability in Werkzeug that allows browsers to allow nameless cookies.
Which browsers are affected by CVE-2023-23934?
Any vulnerable browser that allows "nameless" cookies can be affected.
What is the severity of CVE-2023-23934?
The severity of CVE-2023-23934 is low, with a severity score of 3.5.
How can I fix CVE-2023-23934?
To fix CVE-2023-23934, update to Werkzeug version 2.2.3 or later.
Where can I find more information about CVE-2023-23934?
You can find more information about CVE-2023-23934 on the official GitHub page of Pallets Werkzeug.