github.com/labstack/echo/v4: Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls
What fixes it
- 4.16.1github.com/labstack/echo/v4, goGitHub
go get github.com/labstack/echo/v4@v4.16.1 - 5.4.1github.com/labstack/echo/v5, goGitHub
go get github.com/labstack/echo/v5@v5.4.1 - 4.16.1github.com/labstack/echo/v4, GoOSV
go get github.com/labstack/echo/v4@v4.16.1 - 5.4.1github.com/labstack/echo/v5, GoOSV
go get github.com/labstack/echo/v5@v5.4.1
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Reports 2
1 outlet mention it. Reports are not confirmation; each links to its source.
- @stemshop.bsky.social: ๐จ CVE-2026-118264 โ CVSS 9.1 CRITICAL Echo is a Go web framework. From 4.0.0 until 4.16.1 and 5.4.1, Echo's Proxy middleware selects a raw tunnel... ๐ https://stemshop.top/cve/CVE-Bluesky: CVE posts, 28 Oct 2026
- @stackflag.bsky.social: CVE-2026-118264 - echo In certain versions of the Echo web framework, a rejected WebSocket upgrade can let later requests skip the normal route checks and go straight to the backenBluesky: CVE posts, 28 Oct 2026
Description
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.
Text from GitHub Advisory Database
Affected versions 6
- github.com/labstack/echo/v4, go>= 4.0.0, < 4.16.1GitHub
- github.com/labstack/echo/v5, go>= 5.0.0, < 5.4.1GitHub
- echoaffected: >= 4.0.0, < 4.16.1CVE List
- echoaffected: >= 5.0.0, < 5.4.1CVE List
- github.com/labstack/echo/v4, Gofrom 4.0.0, fixed in 4.16.1OSV
- github.com/labstack/echo/v5, Gofrom 5.0.0, fixed in 5.4.1OSV
References 6
- github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaecFixvia CVE List
- github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421fFixvia CVE List
- github.com/labstack/echo/releases/tag/v4.16.1Fixvia CVE List
- github.com/labstack/echo/releases/tag/v5.4.1Fixvia CVE List
- github.com/labstack/echo/security/advisories/GHSA-cxf3-9h37-7rr8Advisoryvia CVE List
- github.com/advisories/GHSA-cxf3-9h37-7rr8Advisoryvia GitHub