github.com/labstack/echo/v4
Affected
- introduced
4.0.0, fixed4.16.1(semver)
Fixed versions
4.16.1
Fix
- Fixed version
4.16.1go get github.com/labstack/echo/[email protected]
Advisory
Also known as: CVE-2026-118264, GO-2026-6839
Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls
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.
Critical Basis: The source's own band: CRITICAL
4.0.0, fixed 4.16.1 (semver)4.16.1
4.16.1go get github.com/labstack/echo/[email protected]5.0.0, fixed 5.4.1 (semver)5.4.1
5.4.1go get github.com/labstack/echo/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0