Microdot CVE-2026-42874
LOWAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker discovers XSS in application
-
DeliveryInjects JavaScript payload into victim's browser
-
ExploitJavaScript sends request with malicious cookie value (containing \r\n) to server
-
InstallServer's set_cookie() fails to sanitize and constructs header with CRLF
-
C2Response splitting injects arbitrary HTTP header
-
ExecuteClient processes injected header (e.g., sets unauthorized cookie)
-
ImpactAttacker achieves privilege escalation or session hijacking on compromised client
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization HTTP response header sanitization
|
| Exploitation Conditions | Exploitation requires a specific two-stage attack chain: (1) An independent XSS vulnerability or other client-side compromise must allow the attacker to send a request with malicious cookie parameters to the Microdot application. (2) The application must pass user-controlled input directly to Response.set_cookie() without sanitization - specifically, the attacker's input must reach the cookie name, value, domain, or path parameter. (3) The attacker must trick or control the victim's browser to send this malicious request so that the server sets the cookie for that client. The vulnerability does NOT allow remote unauthenticated code execution or server-wide impact; it is limited to header injection affecting only the compromised client's response. Non-default configuration is not required - any application using Response.set_cookie() with untrusted input is vulnerable. Default Microdot installations are affected if the application code passes user input to set_cookie(). |
| Impact | Despite a moderate CVSS score of 3.7, this vulnerability carries limited real-world risk. The attack vector is network-accessible (AV:N) but requires high complexity (AC:H) and no privileges (PR:N), reflecting the significant prerequisite: the attacker must first compromise a specific client via an independent XSS attack to inject malicious cookie data that the server then processes. The integrity impact is limited (I:L) with no confidentiality or availability impact. EPSS data is unavailable, so exploitation probability cannot be quantified; however, the attack chain (XSS → cookie injection → header injection on a single client) is impractical at scale. The CVSS vector AC:H flag correctly indicates that exploitation is not straightforward - the attacker cannot directly trigger set_cookie() with malicious input but must first control a victim's client. This is a secondary injection risk rather than a primary vulnerability, and affects only the compromised client, not server-wide operations. Patch availability and active exploitation data do not change this risk posture: the vulnerability is real but constrained by its exploitation requirements. |
| Exploit ScenarioDerived | An attacker discovers an XSS vulnerability in a Microdot-based web application and injects JavaScript into a page. When a victim user visits the compromised page, the JavaScript executes in their browser and crafts a request to the legitimate application with a malicious cookie value containing \r\nSet-Cookie: admin=true. The server's Response.set_cookie() method, lacking CRLF validation, incorporates this value into the Set-Cookie header, splitting the response and injecting an additional Set-Cookie header that grants the attacker's session elevated privileges. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 05, 2026
HTTP response splitting in Microdot's Response.set_cookie() method allows header injection attacks when an attacker-controlled XSS payload reaches the server and is stored as a cookie value. The vulnerability stems from unsanitized carriage return and linefeed characters (\r\n) in cookie parameters, enabling an attacker to inject arbitrary HTTP headers. Exploitation requires prior client-side compromise (XSS), limiting the attack to a single compromised client per incident.
RemediationAI
Upgrade Microdot to version 2.6.1 or later, which adds validation to reject any cookie parameters containing carriage return or linefeed characters. Apply this patch immediately across all environments running Microdot applications that accept user input destined for cookies. Until patched, avoid passing untrusted or user-controlled data directly to Response.set_cookie(); if user input must be stored in cookies, sanitize it at the application level by stripping or encoding CRLF sequences before passing to set_cookie(). The patch reference is available at https://github.com/miguelgrinberg/microdot/commit/99b281b45faef8472410f2d56bfef496dfbd95d5. Note that the underlying application XSS vulnerability that allows an attacker to inject malicious cookie data in the first place must also be remediated; this patch alone does not protect against XSS, only against the server's unsafe handling of CRLF in cookies.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Microdot is a lightweight Python web framework (pip package microdot). The vulnerability exists in the Response.set_cookie() method, which handles HTTP Set-Cookie headers. CWE-113 (Improper Neutralization of CRLF Sequences in HTTP Headers) defines the root cause: the method fails to detect or escape carriage return (\r, 0x0d) and linefeed (\n, 0x0a) bytes in cookie name, value, domain, and path parameters. These bytes are valid HTTP header delimiters; when injected into a Set-Cookie header, they allow an attacker to synthesize additional HTTP headers or terminate the header block prematurely, leading to response splitting. The fix validates the entire constructed HTTP cookie string and raises a ValueError if CRLF sequences are detected, preventing malformed headers from being transmitted.
Know when the next one hits your stack
- 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
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
Primary rating from Vendor (https://github.com/miguelgrinberg/microdot) · only source for this CVE.
CVSS VectorVendor: https://github.com/miguelgrinberg/microdot
DescriptionCVE.org
Impact
The Response.set_cookie() method does not sanitize its string arguments, and in particular will not detect the presence of the \r\n sequence in them. This can be a potential source of header injection attacks.
For a header injection attack through this issue to be possible, an attacker must first infiltrate the client (for example through an independent XSS attack), so that it can send malicious information that is destined to be stored in a cookie by the server on behalf of the victim. An attacker that infiltrates one client can only orchestrate a header injection attack for that client, all other clients that were not infiltrated are safe.
Patches
Upgrade to version 2.6.1.
Workarounds
Do not pass untrusted data to the Response.set_cookie() method.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
NVD
CVE.org
EPSS
GitHub
Exploit-DB