CVE-2026-16052: 
Python Interpreter vulnerability analysis and mitigation

Overview

CVE-2026-16052 is a cookie attribute injection vulnerability in Python's http.cookies.Morsel class, classified as a security feature bypass. The class fails to reject semicolons (;) in cookie attribute values such as Domain, Path, SameSite, and Version, and includes them verbatim in all output formats. This affects CPython versions prior to 3.16.0, as reported by the Python Software Foundation. It was published on November 12, 2026, with a CVSS v4.0 base score of 2.3 (Low) (Github Advisory, Feedly).

Technical details

The root cause is CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component). The _has_control_character() validator introduced in the CVE-2026-0672 fix only checks for C0 control characters ([\x00-\x1F\x7F]) and does not reject semicolons (0x3B), which are the Set-Cookie attribute delimiter per RFC 6265. When an application reflects untrusted input into cookie attributes via Morsel.OutputString(), an attacker can inject arbitrary additional Set-Cookie attributes by embedding a semicolon followed by a crafted attribute string (e.g., ; SameSite=None or ; Domain=.attacker.com). Exploitation requires that the attacker control the value of a cookie attribute and that a user passively interacts with the affected application (CPython Issue, CPython PR).

Impact

Successful exploitation allows an attacker to inject additional cookie attributes, enabling two primary attack scenarios: SameSite policy downgrade (weakening cross-site request forgery protections) and parent Domain expansion (causing a cookie to be sent to a broader set of domains than intended). There is no direct confidentiality or availability impact; the integrity impact is limited to cookie attribute manipulation. This could facilitate session hijacking or cross-site request forgery attacks in applications that reflect untrusted input into cookie attributes (Github Advisory, CPython Issue).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date. The EPSS score is approximately 0.305% (24th percentile), indicating a low near-term exploitation probability. The NVD SSVC assessment classifies exploitation as "none" and the attack as non-automatable. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog (Github Advisory, Feedly).

Exploitation steps

  1. Identify a vulnerable target: Find a Python web application using CPython < 3.16.0 that reflects attacker-controlled input into cookie attribute values (e.g., Domain, Path, SameSite) via the http.cookies.Morsel class.
  2. Craft a malicious input: Prepare a value containing a semicolon followed by a desired injected attribute, such as example.com; SameSite=None for a Domain value or example.com; Domain=.attacker.com to expand the cookie scope.
  3. Deliver the payload: Submit the crafted value through any application input vector that is reflected into a cookie attribute (e.g., a form field, URL parameter, or API request that influences cookie generation).
  4. Observe injected cookie: The server's Set-Cookie response header will include the injected attribute verbatim, e.g., Set-Cookie: session=abc; Domain=example.com; SameSite=None, relaxing the intended security policy.
  5. Exploit weakened restrictions: With SameSite downgraded or Domain expanded, leverage the weakened cookie policy to perform cross-site request forgery or to receive the cookie on unintended domains (CPython Issue, CPython PR).

Indicators of compromise

  • Network: Set-Cookie response headers containing unexpected semicolons within attribute values (e.g., Domain=value; SameSite=None where the application did not intend to set SameSite=None); cookies being sent to unexpected domains.
  • Logs: Web server or application logs showing unusual values in cookie attribute fields, particularly those containing semicolons or unexpected attribute names appended to standard attributes.
  • Application Behavior: Cookies appearing with relaxed SameSite policies (e.g., None) or broader Domain scopes than configured, especially when user-controlled input is reflected into cookie attributes.

Mitigation and workarounds

The fix was merged into CPython main on November 12, 2026 (PR #161711), and backports were initiated for branches 3.11, 3.12, 3.13, 3.14, and 3.15. Upgrading to CPython 3.16.0 or a patched backport release is the recommended remediation. As an interim workaround, developers should validate and sanitize all untrusted input before using it as a cookie attribute value, explicitly rejecting any input containing semicolons (CPython PR, Github Advisory).

Community reactions

The vulnerability was reported by user @ikow and addressed by contributor brettcs with review from Python core developers including sethmlarson, vstinner, and orsenthil. The fix was described as straightforward — refusing semicolons in all cookie attributes except Comment — and was merged promptly after review. The Python security announcement was posted to the security-announce@python.org mailing list (CPython Issue, CPython PR).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

python3.11

Affected

sid

python3.15

Affected

trixie

python3.13

Affected

Ubuntu

Unknown

bionic (esm-apps)

python3.7

Unknown

bionic (esm-infra)

python2.7

Unknown

devel

python3.14

Unknown

focal (esm-apps)

python2.7

Unknown

focal (esm-infra)

python3.8

Unknown

jammy

python2.7

Unknown

jammy (esm-apps)

python2.7

Unknown

noble

python3.12

Unknown

RHEL / CentOS

Affected

RHEL 8

python3.12.src

Affected

RHEL 9

python3.9.src

Affected

RHEL 10

python3.12.src

Affected

Source: This report was generated using AI

Related Python Interpreter vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-115559MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.16-debuginfo
NoYesNov 10, 2026
CVE-2026-124249MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.12-idle
NoYesNov 09, 2026
CVE-2026-115791MEDIUM5.3
  • Python Interpreter logoPython Interpreter
  • python3
NoYesNov 10, 2026
CVE-2026-16052LOW2.3
  • Python Interpreter logoPython Interpreter
  • python3.14-freethreading-libs
NoYesNov 12, 2026
CVE-2026-19552NONEN/A
  • Python Interpreter logoPython Interpreter
  • python-tools
NoYesNov 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management