CVE-2026-42874
Received Received - Intake
HTTP Header Injection in Microdot Framework

Publication date: 2026-05-11

Last updated on: 2026-05-11

Assigner: GitHub, Inc.

Description
Microdot is a minimalistic Python web framework. Prior to 2.6.1, 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. This vulnerability is fixed in 2.6.1.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-11
Last Modified
2026-05-11
Generated
2026-05-12
AI Q&A
2026-05-12
EPSS Evaluated
N/A
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
miguelgrinberg microdot to 2.6.1 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-113 The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability in Microdot's Response.set_cookie() method allows header injection attacks limited to a compromised client, which could potentially lead to manipulation of HTTP headers and cookies.

While the CVE description and resources do not explicitly mention compliance with standards such as GDPR or HIPAA, improper handling of cookies and header injection vulnerabilities can pose risks to data integrity and confidentiality.

Such vulnerabilities could indirectly affect compliance by enabling attacks that compromise user data or session integrity, which are critical aspects under regulations like GDPR and HIPAA.

However, since the attack requires prior client compromise and is limited to that client, the overall risk is considered low (CVSS score 3.7), and the vulnerability is fixed in version 2.6.1.


Can you explain this vulnerability to me?

CVE-2026-42874 is a vulnerability in the Microdot Python web framework versions prior to 2.6.1. The issue lies in the Response.set_cookie() method, which does not sanitize its string arguments and fails to detect the presence of carriage return and newline sequences (\r\n). This flaw can lead to HTTP header injection attacks, specifically HTTP response splitting.

For an attacker to exploit this vulnerability, they must first compromise a client (for example, through an independent cross-site scripting (XSS) attack) to send malicious data that the server will store in a cookie. The attack is limited to the compromised client only, and other clients remain unaffected.

The vulnerability is fixed in Microdot version 2.6.1 by adding validation checks that reject cookies containing malicious characters such as carriage returns and newlines.


How can this vulnerability impact me? :

This vulnerability can allow an attacker who has already compromised a client to perform HTTP header injection attacks via the Response.set_cookie() method. Such attacks can manipulate HTTP headers, potentially leading to HTTP response splitting.

The impact is limited to the compromised client only, meaning the attacker cannot affect other users of the application who have not been infiltrated.

The severity of this vulnerability is rated as Low with a CVSS score of 3.7, indicating limited impact and exploitability.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability involves HTTP response splitting via the Response.set_cookie() method when it does not sanitize string arguments containing \r\n sequences. Detection involves monitoring for unusual or malicious cookie values that include carriage return and newline characters, which could indicate an attempt at header injection.

Since the attack requires an attacker to first infiltrate a client (e.g., through XSS) to send malicious data stored in a cookie, network detection could focus on inspecting HTTP responses for suspicious cookie headers containing CRLF sequences.

There are no specific commands provided in the available resources to detect this vulnerability directly.


What immediate steps should I take to mitigate this vulnerability?

The primary mitigation is to upgrade the Microdot framework to version 2.6.1 or later, where the Response.set_cookie() method properly sanitizes cookie values and rejects those containing carriage return and newline characters.

As a workaround before upgrading, avoid passing untrusted or user-controlled data to the set_cookie() method to prevent injection of malicious characters.

The fix also includes validation that raises errors if invalid cookie values are detected, so ensuring your application handles such exceptions can help mitigate risks.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart