Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls
Published 23 Oct 2026 · Updated 5 Nov 2026
Is your project on an affected github.com/labstack/echo/v4?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=4.0.0 <4.16.1
- Fixed in
- 4.16.1
go get github.com/labstack/echo/v4@v4.16.1- Affected
- >=5.0.0 <5.4.1
- Fixed in
- 5.4.1
go get github.com/labstack/echo/v5@v5.4.1Details
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 or 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.
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.
Is GHSA-cxf3-9h37-7rr8 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/labstack/echo/v4, and gives you the command that fixes it.
More advisories for github.com/labstack/echo/v4
- LowCVE-2026-118653Rate Limiter Bypass via Spoofed X-Forwarded-For Header in Default Configuration in github.com/labstack/echo · 5 Nov 2026
- LowCVE-2026-118650URL-encoded path bypasses route/group middleware guarding a statically-served path in github.com/labstack/echo · 5 Nov 2026
- LowCVE-2026-118651Reverse Proxy Forwards Attacker-Supplied X-Real-IP to Upstream by Default in github.com/labstack/echo · 5 Nov 2026
- LowCVE-2026-118652Cross-Site Scripting (XSS) via unsanitized JSONP callback in github.com/labstack/echo · 5 Nov 2026
- LowCVE-2026-118266Echo has CSRF Protection Bypass via MethodOverride Rewriting POST to Safe Method in github.com/labstack/echo · 5 Nov 2026
- LowCVE-2026-118658Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto in github.com/labstack/echo · 5 Nov 2026
References
- Linkgithub.com/labstack/echo/security/advisories/GHSA-cxf3-9h37-7rr8
- Linkgithub.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec
- Linkgithub.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f
- Packagegithub.com/labstack/echo
- Linkgithub.com/labstack/echo/releases/tag/v4.16.1
- Linkgithub.com/labstack/echo/releases/tag/v5.4.1
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.