Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served path
CVE-2026-118650
Summary When middleware.Static is mounted globally (e.Use(middleware.Static(...))) and an application relies on a route- or group-level middleware guard to restrict a path that also falls under the served static root, a %2F-encoded request bypasses that guard while the file is still served. This is the same encoding/decoding mismatch fixed for StaticFS/StaticDirectoryHandler in CVE-2026-55677 / GHSA-vfp3-v2gw-7wfq, but the fix did not cover the middleware.Static path. In addition, the StaticConfig.EnablePathUnescaping docstring states the default configuration prevents exactly this bypass, which is inaccurate for the global-mount case. This is not path traversal: no file outside the static root is accessed. The served file lives inside the static root; the issue is that access-control expectations set by a route guard are inconsistent between the literal and %2F-encoded forms of the same path. Details Root cause — the router and the static handler disagree on how to interpret %2F: The router matches routes on the raw, still-encoded path, so GET /admin%2Fsecret.txt does not match a /admin/... route or group; any middleware attached to that route/group is therefore skipped.…
Assessment
- CVSS
- 7.5 (v3.1)
- Severity
- High
- EPSS
- 0.00396% chance of exploitation in the next 30 days
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 28 October 2026
- Last updated
- 28 October 2026
- Affected
- go · github.com/labstack/echo/v5, github.com/labstack/echo/v4
- Weakness
- CWE-177, CWE-863
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
At the source
References
- https://github.com/labstack/echo/security/advisories/GHSA-375p-5qhx-8wq4
- https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1
- https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af
- https://github.com/labstack/echo/releases/tag/v4.16.0
- https://github.com/labstack/echo/releases/tag/v5.4.0
- https://github.com/advisories/GHSA-375p-5qhx-8wq4
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-118650