What’s Vulnerable › Vulnerabilities
CVE-2026-6019: BaseCookie.js_output() does not neutralize embedded characters
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2026-04-22 · updated 2026-10-26
- Weakness: CWE-150
Description
http.cookies.Morsel.js_output() returns an inline <script> snippet and only escapes " for JavaScript string context. It does not neutralize the HTML parser-sensitive sequence </script> inside the generated script element. Mitigation base64-encodes the cookie value to disallow escaping using cookie value.
Affected products
- Python: before 3.13.14; from 3.14.0 through 3.14.4; 3.15.0-alpha1, 3.15.0-alpha2, 3.15.0-alpha3, 3.15.0-alpha4, 3.15.0-alpha5, 3.15.0-alpha6 (+2) — fixed in 3.13.14
How to fix
Upgrade to a fixed version: Python 3.13.14. Check the vendor advisory for mitigations.
References
- https://github.com/python/cpython/commit/3c59b8b53fc75c7f9578d16fb8201ceb43e8f76c
- https://github.com/python/cpython/commit/76b3923d688c0efc580658476c5f525ec8735104
- https://github.com/python/cpython/commit/f795e042043dfe26c42e1971d4502c1cdc4c65b8
- https://github.com/python/cpython/issues/90309
- https://github.com/python/cpython/pull/148848
- https://mail.python.org/archives/list/security-announce@python.org/thread/IVNWGV2BBNC3RHQAFS22UP4DY56SAXX3/
Get alerted when CVE-2026-6019 or the next vulnerability affects your stack