Skip to main content

Microdot CVE-2026-42874

LOW
HTTP Response Splitting (CWE-113)
2026-05-05 https://github.com/miguelgrinberg/microdot
3.7
CVSS 3.1 · Vendor: https://github.com/miguelgrinberg/microdot
View

Attack ChainAIDerived

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

  1. Recon
    Attacker discovers XSS in application
  2. Delivery
    Injects JavaScript payload into victim's browser
  3. Exploit
    JavaScript sends request with malicious cookie value (containing \r\n) to server
  4. Install
    Server's set_cookie() fails to sanitize and constructs header with CRLF
  5. C2
    Response splitting injects arbitrary HTTP header
  6. Execute
    Client processes injected header (e.g., sets unauthorized cookie)
  7. Impact
    Attacker 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.

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 – 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

pypi microdot fix: 2.6.1

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

Vendor (https://github.com/miguelgrinberg/microdot) PRIMARY 3.7 LOW
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

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

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

EPSS Score
0.0%
Top 88% exploitable
Data Quality
4 sources
Confidence: Medium

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· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Low

Priority Score

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

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

pkg:pip/microdot

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