Skip to main content

CPython EUVDEUVD-2026-25079

| CVE-2026-6019 LOW
Improper Neutralization of Escape, Meta, or Control Sequences (CWE-150)
2026-04-22 PSF
2.1
CVSS 4.0 · Vendor: PSF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain high privilege system access
  2. Delivery
    Craft malicious cookie value with </script> injection
  3. Exploit
    Call Morsel.js_output() in vulnerable code
  4. Execution
    HTML parser terminates script element prematurely
  5. Persist
    Injected JavaScript executes in document context
  6. Impact
    Information disclosure or DOM manipulation

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Escape character neutralization
Exploitation Conditions

Exploitation requires the following specific conditions: (1) The attacker must have high privilege level (PR:H) to set or manipulate cookie values on the target system - this typically means system-level access, compromised server process, or administrative capability; (2) The victim application must explicitly call http.cookies.Morsel.js_output() to serialize cookies as inline JavaScript, a non-default and relatively uncommon pattern in modern web applications that typically use JSON or HTTP-only cookies; (3) The generated script output must be inserted into an HTML page without additional escaping, allowing the HTML parser to interpret the injected </script> sequence; (4) The victim must view or interact with the page containing the injected script in a browser that processes inline scripts. The vulnerability does NOT affect standard cookie handling via Set-Cookie headers or HTTP-only cookie flags. Default configurations of CPython applications are protected if they do not explicitly use js_output() for cookie serialization in user-facing content.

Impact

Despite the low CVSS score of 2.1, this vulnerability presents a subtle but real risk requiring contextual assessment. The CVSS vector shows attack vector network (AV:N) and low attack complexity (AC:L), but critical limiting factors severely constrain real-world exploitation: the attacker requires high privileges (PR:H), attack timing is unpredictable (AT:P), and impact is limited to confidentiality and integrity of the target (VC:L, VI:L, no availability impact). SSVC framework confirms 'Exploitation: none' (no active exploitation), 'Automatable: no' (requires manual crafting and high privileges), and 'Technical Impact: partial' (limited scope). The low CVSS reflects these constraints accurately - this is not a high-impact vulnerability despite network accessibility. Real-world risk is low because exploitation requires an attacker with high system privileges to craft and inject malicious cookies, a scenario unlikely in typical threat models. The vulnerability is primarily a defense-in-depth concern: improper escaping in a library function that developers might assume is safe for HTML output. SSVC and CVSS signals align, indicating a lower-priority remediation compared to network-accessible pre-authentication vulnerabilities.

Exploit ScenarioDerived

An attacker with high system privileges (e.g., a compromised server process or malicious system administrator) crafts a Python cookie with a value containing </script> followed by arbitrary JavaScript (e.g., cookie_value = 'test</script><script>alert(1)</script>'). When http.cookies.Morsel.js_output() processes this cookie, it generates an HTML snippet such as <script>var mycookie="test</script><script>alert(1)</script>";</script>. The HTML parser interprets </script> as the end of the first script element and parses the injected script tag as new HTML content, executing the attacker's JavaScript in the document context.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 23, 2026

CPython's http.cookies.Morsel.js_output() method generates inline script snippets that fail to neutralize the HTML parser-sensitive sequence </script>, allowing attackers with high privilege levels to inject arbitrary JavaScript by crafting malicious cookie values. While the method escapes double quotes for JavaScript string context, it does not prevent premature termination of the script element through </script> injection, resulting in limited information disclosure. The vendor has released patches addressing this inadequate escaping mechanism through base64-encoding of cookie values.

RemediationAI

Upgrade CPython to version 3.15.0 or later to receive the vendor-released patch that base64-encodes cookie values in the http.cookies.Morsel.js_output() method (see https://github.com/python/cpython/pull/148848 and commit 76b3923d688c0efc580658476c5f525ec8735104). If immediate upgrade is not possible, the primary workaround is to avoid relying on http.cookies.Morsel.js_output() for generating script content; instead, use alternative cookie serialization methods that do not embed cookie values directly in HTML script elements. If cookie values must be embedded in JavaScript, manually apply base64-encoding or use a robust HTML/JavaScript escaping library (such as markupsafe or bleach) before passing values to Morsel.js_output(). This adds processing overhead but eliminates parser-sensitive sequence injection. A secondary control is to enforce Content Security Policy (CSP) headers that restrict inline script execution, mitigating the impact of injected script content, though this does not prevent the underlying escaping flaw and may break legitimate functionality.

Affected VersionsENISA

CPython 0 <3.15.0

Affected Packages

euvd cpython fix: 3.15.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in Python's standard library http.cookies module, specifically the Morsel.js_output() method which generates HTML script elements containing cookie values. The root cause is incomplete output encoding (CWE-150) - the function escapes only double-quote characters for JavaScript string context but does not account for HTML parser-sensitive sequences like </script> that can prematurely close the script element. When a cookie value contains </script>, the HTML parser interprets this as the end of the script block regardless of JavaScript string context, allowing execution of injected HTML/JavaScript that follows. The fix employs base64-encoding of cookie values to eliminate any characters that could be misinterpreted by the HTML parser, ensuring the entire value is treated as opaque data within the script string.

Know when Cpython gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (PSF) PRIMARY 2.1 LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (PSF) · only source for this CVE.

CVSS VectorVendor: PSF

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
CVSS changed
Apr 22, 2026 - 20:22 NVD
2.1 (LOW)
Patch released
Apr 22, 2026 - 20:01 nvd
Patch available
CVE Published
Apr 22, 2026 - 19:28 nvd
LOW 2.1

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-19445 CRITICAL
9.2 Sep 30

A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-11940 HIGH
7.8 Jun 23

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter

CVE-2026-19553 HIGH
7.6 Sep 30

Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

CVE-2026-7774 MEDIUM
6.9 Jun 04

Path traversal in CPython's tarfile module allows malicious tar archives to bypass the data_filter safety mechanism and

CVE-2026-19672 MEDIUM
6.3 Aug 19

CPython's tarfile module on POSIX platforms creates empty directories outside the intended extraction destination when p

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy