Go
CVE-2026-118650
Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served path
- Severity
- High 7.5
- Published
- 28 Oct 2026
- Last changed
- 5 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.16.0, 5.4.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Read data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Also known as
- GHSA-375p-5qhx-8wq4, GO-2026-6873
- Sources
- OSV.dev and GitHub
Description
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.
Root cause — the router and the static handler disagree on how to interpret %2F:
Workarounds
Keep files that need protection outside the Static middleware's root directory.
Affected software
| Software | Affected versions |
|---|---|
github.com/labstack/echo/v4Go · osv:Go:github.com/labstack/echo/v4 |
|
github.com/labstack/echo/v5Go · osv:Go:github.com/labstack/echo/v5 |
|
About github.com/labstack/echo/v4
Vulnerabilities in github.com/labstack/echo/v4
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118657Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme HeadersMedium 5.9 28 Oct 2026
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118652Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlobMedium 6.1 28 Oct 2026
About github.com/labstack/echo/v5
Vulnerabilities in github.com/labstack/echo/v5
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118657Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme HeadersMedium 5.9 28 Oct 2026
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118652Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlobMedium 6.1 28 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-118650
- GitHub Advisory Database https://github.com/advisories/GHSA-375p-5qhx-8wq4