{"id":"GHSA-cxf3-9h37-7rr8","kind":"vulnerability","aliases":["GHSA-cxf3-9h37-7rr8"],"related":[],"title":"Echo: Rejected WebSocket upgrades can bypass Echo route-level access controls","description":"## 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.","summary":"Echo's Proxy middleware sends a WebSocket upgrade request straight into a raw tunnel before checking whether the upstream accepted it. If the upstream refuses the upgrade but keeps the connection open, later HTTP requests on that connection go straight to the upstream and skip Echo's route-level auth.","severity":"critical","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/labstack/echo/v4","fixed":["4.16.1"],"affected":">= 4.0.0, < 4.16.1","ecosystem":"go"},{"name":"github.com/labstack/echo/v5","fixed":["5.4.1"],"affected":">= 5.0.0, < 5.4.1","ecosystem":"go"}],"ecosystems":["go"],"tags":["cwe-444","cwe-863","echo","go","package","reverse-proxy","websocket"],"not_affected_if":["no-proxy-middleware","static-export","upstream-enforces-own-auth"],"how_to_check":"Check whether the app imports github.com/labstack/echo/v4 below 4.16.1 or github.com/labstack/echo/v5 below 5.4.1 in go.mod (go list -m github.com/labstack/echo/v4).\nCheck whether any Echo route uses middleware.Proxy or ProxyWithConfig for a WebSocket-capable upstream that enforces auth only in Echo.","fix":"Upgrade to github.com/labstack/echo/v4 v4.16.1 or github.com/labstack/echo/v5 v5.4.1.\nUntil then, reject WebSocket upgrade requests before they reach affected proxy routes, or enforce authorization on the upstream itself.","status":"open","published_at":"2026-10-23T20:49:37+00:00","first_seen_at":"2026-10-23T20:59:05+00:00","triaged_at":"2026-10-23T21:00:34+00:00","updated_at":"2026-10-23T21:00:34+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-23T21:00:34Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade to github.com/labstack/echo/v4 v4.16.1 or github.com/labstack/echo/v5 v5.4.1.\nUntil then, reject WebSocket upgrade requests before they reach affected proxy routes, or enforce authorization on the upstream itself.","reach":"internet","impact":"high","summary":"Echo's Proxy middleware sends a WebSocket upgrade request straight into a raw tunnel before checking whether the upstream accepted it. If the upstream refuses the upgrade but keeps the connection open, later HTTP requests on that connection go straight to the upstream and skip Echo's route-level auth.","category":"package","who_cares":["go","echo","reverse-proxy","websocket"],"confidence":0.8,"needs_auth":"unknown","worst_case":"Attacker reaches upstream resources that Echo route middleware was meant to protect.","analyst_note":"","how_to_check":"Check whether the app imports github.com/labstack/echo/v4 below 4.16.1 or github.com/labstack/echo/v5 below 5.4.1 in go.mod (go list -m github.com/labstack/echo/v4).\nCheck whether any Echo route uses middleware.Proxy or ProxyWithConfig for a WebSocket-capable upstream that enforces auth only in Echo.\nunknown","needs_analyst":false,"not_affected_if":["no-proxy-middleware","upstream-enforces-own-auth","static-export"],"user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000622,"input_tokens":3499,"output_tokens":545,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-101':321C '-444':30B '-863':32B '/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec).':296C '/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f),':292C '/labstack/echo/releases/tag/v4.16.1)':253C '/labstack/echo/releases/tag/v5.4.1).':258C '/labstack/echo/v4':25A '/labstack/echo/v5':28A '7rr8':17A,22A '9h37':16A,21A 'accept':59B,113C 'access':11A,167C 'affect':206C,305C 'aliv':127C 'also':238C 'arbitrari':196C 'arbitrary-host':195C 'auth':90B 'authent':155C,205C 'author':157C,189C,311C 'bypass':6A,154C,200C 'check':55B 'client':102C 'close':177C 'commit':288C 'configur':111C 'confirm':230C 'connect':70B,77B,126C,133C,179C 'control':12A 'credit':333C 'cwe':29B,31B 'cxf3':15A,20A 'direct':136C 'duodum':336C 'echo':1A,7A,33B,40B,85B,92C,144C,161C,306C 'enforc':158C,310C 'enter':271C 'everi':314C 'exploit':164C 'fix':287C 'forward':135C 'ghsa':14A,19A 'ghsa-cxf3-9h37-7rr8':13A,18A 'github.com':24A,27A,252C,257C,291C,295C 'github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec).':294C 'github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f),':290C 'github.com/labstack/echo/releases/tag/v4.16.1)':251C 'github.com/labstack/echo/releases/tag/v5.4.1).':256C 'github.com/labstack/echo/v4':23A 'github.com/labstack/echo/v5':26A 'go':34B,78B,265C 'histori':237C 'host':197C 'http':73B,121C,129C,267C,285C 'impact':91C 'implement':213C 'independ':188C,312C 'issu':191C 'keep':68B 'kept':124C 'later':72B 'level':10A,89B 'line':222C 'mere':317C 'middlewar':43B,95C,151C 'miss':241C 'non':320C 'open':71B 'ordinari':120C,284C 'packag':35B 'pass':142C 'patch':209C,260C 'present':215C 'prevent':328C 'provid':194C 'proxi':38B,42B,94C,168C,198C,212C,269C,307C 'raw':52B,98C,211C,331C 'reach':304C 'refus':64B 'reject':2A,173C,281C,298C 'releas':221C 'remain':283C 'report':334C 'reproduct':229C 'request':48B,74B,103C,130C,286C,301C 'requir':165C 'resourc':183C,316C 'respons':122C,244C,280C,322C 'return':118C,318C 'revers':37B,268C 'reverse-proxi':36B 'rout':9A,88B,149C,163C,169C,261C,308C 'route-level':8A,87B 'route-specif':148C 'router':146C 'runtim':228C 'select':96C 'send':44B 'show':239C 'skip':84B 'sourc':236C 'specif':150C 'straight':49B,79B 'subsequ':128C 'target':182C 'throughout':216C 'tunnel':53B,99C,273C,332C 'upgrad':4A,47B,66B,106C,175C,243C,248C,263C,279C,282C,300C 'upgrade-respons':242C 'upstream':58B,63B,82B,112C,117C,140C,171C,186C,202C,278C,315C,325C 'v4':218C,289C 'v4.0.0':247C 'v4.15.0':231C 'v4.16.0':225C,232C 'v4.16.1':250C 'v5':220C,293C 'v5.0.0':233C 'v5.4.0':227C,235C 'v5.4.1':255C 'valid':108C,245C,277C 'version':207C 'vulner':330C 'websocket':3A,39B,46B,105C,262C,299C 'whether':56B,109C 'without':141C,176C,187C 'workaround':297C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-23T20:49:37+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-cxf3-9h37-7rr8","url":"https://github.com/advisories/GHSA-cxf3-9h37-7rr8","severity":"critical","published_at":"2026-10-23T20:49:37+00:00","modified_at":"2026-10-23T20:49:38+00:00","first_seen_at":"2026-10-23T20:59:05+00:00","fetched_at":"2026-10-23T20:59:05+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}