{"id":"GHSA-cxf3-9h37-7rr8","title":"Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls","summary":"Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls","severity":"critical","cwe":["CWE-444","CWE-863"],"vendor":"labstack","product":"github.com/labstack/echo/v4","ecosystem":"go","affected":["github.com/labstack/echo/v4 >= 4.0.0, < 4.16.1","github.com/labstack/echo/v5 >= 5.0.0, < 5.4.1"],"patched":["github.com/labstack/echo/v4 4.16.1","github.com/labstack/echo/v5 5.4.1"],"published":"2026-10-23","updated":"2026-10-23","sourceUpdated":"2026-10-23T20:49:38Z","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-cxf3-9h37-7rr8","references":[{"url":"https://github.com/labstack/echo/security/advisories/GHSA-cxf3-9h37-7rr8"},{"url":"https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec"},{"url":"https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f"},{"url":"https://github.com/labstack/echo/releases/tag/v4.16.1"},{"url":"https://github.com/labstack/echo/releases/tag/v5.4.1"},{"url":"https://github.com/advisories/GHSA-cxf3-9h37-7rr8"}],"tags":["ghsa","go"],"ingestedAt":"2026-10-23T21:38:13.042Z","slug":"GHSA-cxf3-9h37-7rr8","body":"## Overview\n\n## Impact\n\nEcho'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.\n\nThis 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.\n\n## Affected versions and patch\n\nThe 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.\n\nUpgrade 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.\n\nFix commits: [v4](https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f), [v5](https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec).\n\n## Workarounds\n\nReject 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.\n\n## Credits\n\nReported by @Duodum.\n\n## Affected packages\n\n- `github.com/labstack/echo/v4 >= 4.0.0, < 4.16.1`\n- `github.com/labstack/echo/v5 >= 5.0.0, < 5.4.1`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/labstack/echo/v4 4.16.1`\n- `github.com/labstack/echo/v5 5.4.1`","depth":"midnight","depthScore":52,"depthScoreParts":{"impact":52.3,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}