Rejected WebSocket upgrades bypass Echo route-level access controls
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-863.
Summary
Echo's Go packages github.com/labstack/echo/v4 from 4.0.0 before 4.16.1 and github.com/labstack/echo/v5 from 5.0.0 before 5.4.1 are affected. The Proxy middleware switches to a raw tunnel on a WebSocket upgrade request before checking whether the upstream accepted it, so a connection kept alive after a rejected upgrade sends later HTTP requests straight to the upstream, skipping Echo's router and route middleware (CWE-444). An attacker who can reach an accessible proxy route can reach upstream resources that lack their own authorization, bypassing access controls enforced only at Echo routes.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
Description from the GitHub advisory
## Impact Echo's Proxy middleware selected a raw tunnel when the client requested a WebSocket upgrade, before validating whether the configured upstream accepted it. If the upstream returned an ordinary HTTP response and kept the connection alive, subsequent HTTP requests on that connection were forwarded directly to the same upstream without passing through Echo's router or route-specific middleware. This can bypass authentication or authorization enforced only at Echo's routes. Exploitation requires an accessible proxy route, an upstream that rejects the upgrade without closing the connection, and a target resource on that upstream without independent authorization. The issue does not provide arbitrary-host proxying or bypass the upstream's own authentication. ## Affected versions and patch The raw proxy implementation is present throughout the v4 and v5 release lines up to v4.16.0 and v5.4.0. Runtime reproductions confirmed v4.15.0, v4.16.0, v5.0.0 and v5.4.0; source history also shows the missing upgrade-response validation in v4.0.0. Upgrade to [v4.16.1](https://github.com/labstack/echo/releases/tag/v4.16.1) or [v5.4.1](https://github.com/labstack/echo/releases/tag/v5.4.1). The patch routes WebSocket upgrades through Go's HTTP reverse proxy and enters a tunnel only after a valid upstream upgrade response. Rejected upgrades remain ordinary HTTP requests. Fix commits: [v4](https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f), [v5](https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec). ## Workarounds Reject WebSocket upgrade requests before they reach affected Echo proxy routes, or enforce authorization independently at every upstream resource. Merely returning a non-101 response from the upstream does not prevent the vulnerable raw tunnel. ## Credits Reported by @Duodum.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/labstack/echo/v4 (Go) | 4.0.0 to before 4.16.1 | 4.16.1 | Patch available | GHSA-cxf3-9h37-7rr8 |
| — | github.com/labstack/echo/v5 (Go) | 5.0.0 to before 5.4.1 | 5.4.1 | Patch available | GHSA-cxf3-9h37-7rr8 |
- github.com/labstack/echo/v4 (Go) Vendor— Affected 4.0.0 to before 4.16.1 Fixed in 4.16.1 Patch available GHSA-cxf3-9h37-7rr8
- github.com/labstack/echo/v5 (Go) Vendor— Affected 5.0.0 to before 5.4.1 Fixed in 5.4.1 Patch available GHSA-cxf3-9h37-7rr8
Remediation
Upgrade github.com/labstack/echo/v4 to 4.16.1 and github.com/labstack/echo/v5 to 5.4.1. The fix commits are 3fb0ba7 for v4 and 1855061 for v5.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
- Fix · GHSA-cxf3-9h37-7rr8 github.com/labstack/echo/v4 (Go) Fixed in 4.16.1 Advisory →
- Fix · GHSA-cxf3-9h37-7rr8 github.com/labstack/echo/v5 (Go) Fixed in 5.4.1 Advisory →
Timeline
- 2026-10-23 Threatist record created from GHSA-cxf3-9h37-7rr8
References
Other 6
- https://github.com/labstack/echo/security/advisories/GHSA-cxf3-9h37-7rr8
- https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec
- https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f
- https://github.com/labstack/echo
- https://github.com/labstack/echo/releases/tag/v4.16.1
- https://github.com/labstack/echo/releases/tag/v5.4.1
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences