CVE-2026-6019 Details
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.
A vulnerability exists in the Python http.cookies module, specifically in the BaseCookie.js_output method. This method generates a JavaScript snippet for embedding cookie values but only partially escapes characters for JavaScript string contexts. It fails to neutralize HTML-sensitive sequences, such as '</script>', which can lead to HTML injection. The issue arises because the method's output can be parsed as HTML, potentially allowing for the injection of malicious scripts. To address this, the vulnerability has been mitigated by base64-encoding the cookie values before embedding them in the JavaScript output, ensuring that any HTML-sensitive characters are properly handled.
Users should ensure that they are using a version of Python where this vulnerability has been addressed. The mitigation involves base64-encoding cookie values before embedding them in JavaScript using the js_output method.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 22, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-116 | Improper Encoding or Escaping of Output | [email protected] |
| CWE-150 | Improper Neutralization of Escape, Meta, or Control Sequences | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| python python | < 3.13.14 >= 3.14.0, <= 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 3.15.0 alpha7 3.15.0 alpha8 |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 27, 2026 | Modified Analysis | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 28, 2026 | Reanalysis | [email protected] |
| May 18, 2026 | Initial Analysis | [email protected] |
| Apr 29, 2026 | CVE Modified | [email protected] |
| Apr 22, 2026 | New CVE Received | [email protected] |