{"id":"CVE-2026-55677","aliases":["CVE-2026-55677","GHSA-vfp3-v2gw-7wfq","GO-2026-6293"],"related":[],"kind":"vulnerability","state":"published","title":"Echo: Encoded slash (%2F) bypasses route-level protection and exposes static files","summary":"Echo is a Go web framework. Prior to 4.15.3 and 5.2.0, Echo's router and static file handler disagree on URL path decoding. The router matches routes using the raw encoded path (preserving %2F as-is), while StaticDirectoryHandler unescapes %2F to / before resolving filesystem paths. This allows an attacker to bypass route-level access controls and read static files without authorization. This vulnerability is fixed in 4.15.3 and 5.2.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Echo is a Go web framework. Prior to 4.15.3 and 5.2.0, Echo's router and static file handler disagree on URL path decoding. The router matches routes using the raw encoded path (preserving %2F as-is), while StaticDirectoryHandler unescapes %2F to / before resolving filesystem paths. This allows an attacker to bypass route-level access controls and read static files without authorization. This vulnerability is fixed in 4.15.3 and 5.2.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nEcho's router and static file handler disagree on URL path decoding. The router matches routes using the raw encoded path (preserving `%2F` as-is), while `StaticDirectoryHandler` unescapes `%2F` to `/` before resolving filesystem paths. This allows an attacker to bypass route-level access controls and read static files without authorization.\n\n### Details\n\n**Root cause 1 — `router.go` lines 798-802:**\nThe router uses `req.URL.RawPath` for route matching when `useEscapedPathForRouting` is false (the default). This means `/admin%2Fsecret.txt` is treated as a single path segment and does NOT match the `/admin/*` route pattern.\n\n```go\nif !r.useEscapedPathForRouting && req.URL.RawPath != \"\" {\n    path = req.URL.RawPath\n}\n```\n\n**Root cause 2 — `echo.go` lines 559-568:**\n`StaticDirectoryHandler` calls `url.PathUnescape()` on the path parameter before opening files. This converts `%2F` back to `/`, resolving `admin/secret.txt` on disk.\n\n```go\nif !disablePathUnescaping {\n    tmpPath, err := url.PathUnescape(p)\n    p = tmpPath\n}\nname := filepath.ToSlash(filepath.Clean(strings.TrimPrefix(p, \"/\")))\n```\n\n### PoC (Screenshot)\nSample:\n<img width=\"1291\" height=\"970\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0bc58059-3e6d-4678-ab25-a5c79b006738\" />\n\n403:\n<img width=\"526\" height=\"194\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2f55ffdd-87b2-4a1b-8a13-130ebad0f257\" />\n\nBypass with encoded slash:\n<img width=\"592\" height=\"203\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1191cd39-ae8f-4d7e-8fb1-cb9cf31f484f\" />\n\n### Impact\n\nUnauthorized static file disclosure. Applications that protect route prefixes with authentication middleware while also serving static files from a broader root are vulnerable. An attacker only needs to encode the slash (`/` → `%2F`) in the URL to bypass all route-level protection.\n\nCommon affected pattern:\n```go\nadminGroup := e.Group(\"/admin\", authMiddleware)\ne.StaticFS(\"/\", os.DirFS(\"public\"))\n```","format":"markdown","source":"ghsa"},{"lang":"en","text":"Encoded slash (%2F) bypasses route-level protection and exposes static files in github.com/labstack/echo/v4 and github.com/labstack/echo/v5","format":"markdown","source":"go"},{"lang":"es","text":"Echo es un framework web de Go. Antes de las versiones 4.15.3 y 5.2.0, el router de Echo y el gestor de archivos estáticos no concuerdan en la decodificación de rutas URL. El router empareja rutas utilizando la ruta codificada en bruto (preservando %2F tal cual), mientras que StaticDirectoryHandler desescapa %2F a / antes de resolver las rutas del sistema de archivos. Esto permite a un atacante eludir los controles de acceso a nivel de ruta y leer archivos estáticos sin autorización. Esta vulnerabilidad está corregida en las versiones 4.15.3 y 5.2.0.","source":"nvd"}],"published":"2026-06-26T16:15:55.633Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 4.15.3","status":"affected"},{"version":">= 5.0.0, < 5.2.0","status":"affected"}],"vendor":"labstack","product":"echo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.2.0"}],"ecosystem":"Go","package":"github.com/labstack/echo/v5","purl":"pkg:golang/github.com/labstack/echo/v5","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.15.3"}],"ecosystem":"Go","package":"github.com/labstack/echo/v4","purl":"pkg:golang/github.com/labstack/echo/v4","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"3.3.10"}],"ecosystem":"Go","package":"github.com/labstack/echo","purl":"pkg:golang/github.com/labstack/echo","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.15.3"}],"ecosystem":"Go","package":"github.com/labstack/echo/v4","purl":"pkg:golang/github.com/labstack/echo/v4","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.2.0"}],"ecosystem":"Go","package":"github.com/labstack/echo/v5","purl":"pkg:golang/github.com/labstack/echo/v5","source":"go"}],"references":[{"url":"https://github.com/labstack/echo/security/advisories/GHSA-vfp3-v2gw-7wfq","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55677","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo/pull/3009","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo/pull/3011","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo/commit/8d1ae9d3360a71672418856d58753af25f2c3986","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo/commit/c3fa2a27ff92b2b8db360de614f999ef1da24725","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/labstack/echo/releases/tag/v4.15.3","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo/releases/tag/v5.2.0","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-26T16:50:52.168Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-55677","url":"https://www.cve.org/CVERecord?id=CVE-2026-55677","licence":"CVE Terms of Use","modified":"2026-06-26T16:50:57.019Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vfp3-v2gw-7wfq","url":"https://github.com/advisories/GHSA-vfp3-v2gw-7wfq","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:14.774Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6293","url":"https://pkg.go.dev/vuln/GO-2026-6293","licence":"CC-BY-4.0","modified":"2026-08-26T15:15:13.215Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-55677","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55677","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"}],"updatedAt":"2026-11-25T22:59:26.502Z","epss":{"score":0.00669,"percentile":0.5321,"date":"2026-12-01T12:00:22.000Z"}}