All vulnerabilities

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
Weakness
CWE-177Incorrect authorization (CWE-863)
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:

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Keep files that need protection outside the Static middleware's root directory.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
github.com/labstack/echo/v4Go · osv:Go:github.com/labstack/echo/v4
  • Every version before 4.16.0
github.com/labstack/echo/v5Go · osv:Go:github.com/labstack/echo/v5
  • Every version before 5.4.0

About github.com/labstack/echo/v4

About github.com/labstack/echo/v5

References