CVE-2026-3644

Incomplete control character validation in http.cookies

Published Mar 16, 2026 CVSS 4.0 · 6 Medium EPSS < 1% KEV · Not listed
Description
The fix for CVE-2026-0672, which rejected control characters in http.cookies.Morsel, was incomplete. The Morsel.update(), |= operator, and unpickling paths were not patched, allowing control characters to bypass input validation. Additionally, BaseCookie.js_output() lacked the output validation applied to BaseCookie.output().

Analysis

AI-generated

Technical impact

The vulnerability arises from an incomplete implementation of control‑character validation within Python’s http.cookies module. Specifically, the Morsel.update() method, the bitwise OR assignment operator (|=), and the unpickling process were not patched to reject control characters, allowing them to bypass the intended checks. Additionally, BaseCookie.js_output() omitted the output validation present in BaseCookie.output(), creating another avenue for malicious characters to be processed by the cookie handling logic. This flaw can enable an attacker to inject arbitrary cookie values or manipulate HTTP headers, potentially leading to header injection, cookie poisoning, or other injection‑related attacks.

Affected Systems

The affected vendor is the Python Software Foundation, product CPython. Specific version information was not included in the CVE data, so affected releases cannot be listed precisely.

Risk and Exploitability

The CVSS score of 6 indicates a medium severity impact. No EPSS data is available, and the vulnerability is not listed in the CISA KEV catalog, suggesting that broad, automated exploitation is not yet documented. The likely attack vector is remote, as crafted HTTP requests containing control characters can be sent to any Python application that uses the http.cookies module to parse incoming cookies. If the application parses user‑supplied cookies without prior validation, an attacker could potentially alter HTTP response headers or inject additional cookies, leading to information disclosure or session hijacking. The absence of detailed exploitation proofs limits the assessment, but the medium score reflects a non‑zero risk when the flaw is present in production code.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade CPython to the latest release containing the complete control‑character validation fix for http.cookies, as provided in the linked commit history.
  • Validate or sanitize all cookie input before passing it to http.cookies.Morsel or any related functions to eliminate any remaining control characters.
  • If upgrading immediately is not possible, consider implementing a temporary check that rejects cookie values containing non‑printable characters or other disallowed patterns.
  • Monitor application logs for anomalous cookie values or repeated header injection attempts, and apply additional defensive coding practices such as using parameterized headers and enforcing strict content‑type validation.

Generated by OpenCVE AI on March 17, 2026 at 01:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4583-1 python3.9 security update
Ubuntu USN Ubuntu USN USN-8509-1 Python vulnerabilities
History
Type Values Removed Values Added
First Time appeared Python python
CPEs cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha1:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha2:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha3:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha4:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha5:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha6:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha7:*:*:*:*:*:*
Vendors & Products Python python
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

Type Values Removed Values Added
First Time appeared Python
Python cpython
Vendors & Products Python
Python cpython
Type Values Removed Values Added
Weaknesses CWE-791
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-116
CWE-20
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description The fix for CVE-2026-0672, which rejected control characters in http.cookies.Morsel, was incomplete. The Morsel.update(), |= operator, and unpickling paths were not patched, allowing control characters to bypass input validation. Additionally, BaseCookie.js_output() lacked the output validation applied to BaseCookie.output().
Title Incomplete control character validation in http.cookies
References
Metrics cvssV4_0

{'score': 6, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-20

    Improper Input Validation

  • CWE-791

    Incomplete Filtering of Special Elements

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Aug 13, 2026, 12:27 AM
Reserved
Mar 6, 2026, 4:13 PM
Status
Modified
Published
Mar 16, 2026, 6:16 PM
Modified
Aug 13, 2026, 1:16 AM
Severity
Moderate
Public date
Mar 16, 2026, 5:37 PM