CVE-2026-6019: CWE-150 Improper neutralization of escape, meta, or control sequences in Python Software Foundation CPython
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.
AI Analysis
Technical Summary
The vulnerability in Python Software Foundation's CPython involves the http.cookies.Morsel.js_output() function, which generates an inline <script> snippet. It escapes only the double quote character for JavaScript string context but does not neutralize the HTML parser-sensitive sequence </script>. This improper neutralization (CWE-150) could allow injection of unintended script termination sequences within the script element. The suggested mitigation is to base64-encode the cookie value to prevent exploitation through crafted cookie content. There is no vendor advisory indicating an official fix or patch at this time.
Potential Impact
The impact is limited due to the low CVSS score (2.1) and the nature of the vulnerability, which involves improper neutralization of escape sequences in a specific function generating inline scripts. This could potentially allow an attacker with high privileges (as indicated by the CVSS vector requiring high privileges) to influence script content via cookie values, but the overall risk is low. No known exploits are reported in the wild.
Mitigation Recommendations
No official patch or remediation level has been provided by the vendor. The recommended mitigation is to base64-encode cookie values before using them in the js_output() method to prevent injection of the </script> sequence. Users should monitor the Python Software Foundation advisories for any forthcoming official fixes.
CVE-2026-6019: CWE-150 Improper neutralization of escape, meta, or control sequences in Python Software Foundation CPython
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.
CVSS v4.0
Score 2.1low
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Python Software Foundation's CPython involves the http.cookies.Morsel.js_output() function, which generates an inline <script> snippet. It escapes only the double quote character for JavaScript string context but does not neutralize the HTML parser-sensitive sequence </script>. This improper neutralization (CWE-150) could allow injection of unintended script termination sequences within the script element. The suggested mitigation is to base64-encode the cookie value to prevent exploitation through crafted cookie content. There is no vendor advisory indicating an official fix or patch at this time.
Potential Impact
The impact is limited due to the low CVSS score (2.1) and the nature of the vulnerability, which involves improper neutralization of escape sequences in a specific function generating inline scripts. This could potentially allow an attacker with high privileges (as indicated by the CVSS vector requiring high privileges) to influence script content via cookie values, but the overall risk is low. No known exploits are reported in the wild.
Mitigation Recommendations
No official patch or remediation level has been provided by the vendor. The recommended mitigation is to base64-encode cookie values before using them in the js_output() method to prevent injection of the </script> sequence. Users should monitor the Python Software Foundation advisories for any forthcoming official fixes.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2026-04-09T15:35:00.668Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e9290319fe3cd2cde955b1
Added to database: 04/22/2026, 20:01:07 UTC
Last enriched: 06/10/2026, 21:41:56 UTC
Last updated: 07/31/2026, 19:23:00 UTC
Views: 143
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.