HIGHCVSS v3.1 7.5Vulnerability

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. - `middleware.Static` selects its path source in `middleware/static.go` (~L219): with a global `e.Use` mount there is no wildcard route, so it uses `c.Request().URL.Path`, which `net/http` has already **decoded** (`%2F` → `/`). It then `path.Clean`s (~L235) and `Open`s (~L259) `admin/secret.txt`, serving the file. Net effect: for the literal path the guard runs; for the `%2F`-encoded path the guard is skipped but the same file is served. Relevant code: - `middleware/static.go` ~L219 (`p := c.Request().URL.Path`), ~L235 (`path.Clean`), ~L259 (`currentFS.Open`) - `StaticConfig.EnablePathUnescaping` docstring (`static.go` ~L60-67) — claims the default prevents the `/admin%2fprivate.txt` → `/admin/*` guard bypass; this is not true for the global moun

Properties

Severity
high
Summary
Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served path
Nvd fetched at
2026-10-28T23:43:43.157973+00:00
Cvss severity
HIGH
Cvss score
7.5
Retrieved at
2026-10-28T23:45:49+00:00
Ghsa published
2026-10-28T19:54:20Z
Source url
https://github.com/advisories/GHSA-375p-5qhx-8wq4
Ghsa updated
2026-10-28T19:54:20Z
Ghsa id
GHSA-375p-5qhx-8wq4
Last source
GitHub Advisory Database
Score
7.5
Cvss version
3.1
Cve id
CVE-2026-118650
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
First seen by Signal
2026-10-28T23:44:40+00:00
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Published at
2026-10-28T20:17:21.850
Last modified
2026-10-28T20:17:21.850

Related Entities (6)

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-118650 (CVSS v3.1 7.5) — Ninja Signal Threat Intelligence | Ninja Signal