Echo static file middleware route protection bypass via encoded dot-dot traversal
Exploitation and risk
Source statusCISA KEV lists vulnerabilities known to be exploited. FIRST EPSS estimates the likelihood of exploitation in the next 30 days. An unavailable score does not mean zero risk.
Which CVEs have scores here?
This view includes predictions for CVE identifiers explicitly listed in public NuGet advisories. Microsoft release pages have their own prediction coverage. Check source status for the scope and latest checks.
No exploitation or prediction data is available here for these CVEs. This does not mean they are safe or unlikely to be exploited.
cve-program · CVE-2026-118654
PublishedEcho is a Go web framework. Prior to 4.16.0 and 5.4.0, Echo's static file handlers can normalize dot segments after route matching and serve a file through a public static route even though the corresponding direct path is protected by route-level middleware. An unauthenticated attacker can read files that an application intended to protect with route-level middleware, when those files are also reachable through a static filesystem mount after path normalization. This vulnerability is the result of an incomplete fix for CVE-2026-55677. This issue is fixed in 4.16.0 and 5.4.0.
- Source published
- 28 Oct 2026 19:59:27 UTC
- Source modified
- 2 Nov 2026 20:43:27 UTC
- Saved here
- 2 Nov 2026 21:57:16 UTC
- Source terms
- CVE Program Terms of Use
Original source record · Cite this exact observation · Complete original publisher JSON
Source: cve-program · CVE Program Terms of Use. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS 3.1 · 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
euvd · EUVD-2026-112459
PublishedEcho is a Go web framework. Prior to 4.16.0 and 5.4.0, Echo's static file handlers can normalize dot segments after route matching and serve a file through a public static route even though the corresponding direct path is protected by route-level middleware. An unauthenticated attacker can read files that an application intended to protect with route-level middleware, when those files are also reachable through a static filesystem mount after path normalization. This vulnerability is the result of an incomplete fix for CVE-2026-55677. This issue is fixed in 4.16.0 and 5.4.0.
Additional publisher context
EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.
Original publisher date fields
datePublished: Oct 28, 2026, 7:59:27 PM
dateUpdated: Nov 2, 2026, 8:43:27 PM
- Source published
- Oct 28, 2026, 7:59:27 PM (timezone not stated)
- Source modified
- Nov 2, 2026, 8:43:27 PM (timezone not stated)
- Saved here
- 16 Nov 2026 07:40:08 UTC
- Source terms
- ENISA EUVD · source terms and attribution apply
Original source record · Cite this exact observation · Complete original publisher JSON
Source: euvd · ENISA EUVD · source terms and attribution apply. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
EUVD CVSS 3.1 · 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
nvd · CVE-2026-118654
PublishedEcho is a Go web framework. Prior to 4.16.0 and 5.4.0, Echo's static file handlers can normalize dot segments after route matching and serve a file through a public static route even though the corresponding direct path is protected by route-level middleware. An unauthenticated attacker can read files that an application intended to protect with route-level middleware, when those files are also reachable through a static filesystem mount after path normalization. This vulnerability is the result of an incomplete fix for CVE-2026-55677. This issue is fixed in 4.16.0 and 5.4.0.
Additional publisher context
NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.
Source analysis status: Undergoing Analysis
Weakness classifications: CWE-22
Original publisher date fields
published: 2026-10-28T20:17:22.550
lastModified: 2026-11-02T21:17:27.753
- Source published
- 28 Oct 2026 20:17:22 UTC
- Source modified
- 2 Nov 2026 21:17:27 UTC
- Saved here
- 3 Nov 2026 23:58:59 UTC
- Source terms
- NIST NVD usage terms; underlying source attribution retained
Original source record · Cite this exact observation · Complete original publisher JSON
Source: nvd · NIST NVD usage terms; underlying source attribution retained. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS 3.1 · [email protected] · Secondary · 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
osv · GHSA-3pmx-cf9f-34xr
Published## Summary Echo v5.2.0 contains a bypass of the fix for GHSA-vfp3-v2gw-7wfq. The fix rejects encoded path separators such as `%2F` and `%5C` before static file path unescaping, but two traversal forms still bypass route-level middleware protections for static files. The primary bypass uses encoded dot-dot segments. A request such as `/public/%2E%2E/admin/secret.txt` passes the encoded-separator guard, is unescaped to `public/../admin/secret.txt`, then `path.Clean` resolves it to `admin/secret.txt`. If `/admin/*` is protected by middleware but the static filesystem is mounted at `/`, the protected file is returned through the public static route. A second bypass exists when `UseEscapedPathForMatching=true`. In that mode, the router normalizes encoded separators before the static handler checks the wildcard. The handler receives a decoded wildcard with no `%` characters, so the encoded-separator guard does not run on the original encoded path. ## Impact An unauthenticated attacker can read files that an application intended to protect with route-level middleware, when those files are also reachable through a static filesystem mount after path normalization. The high-severity variant works with the default router configuration and requires only encoded dot-dot path segments. The direct protected route returns 403, while the public static route returns the protected file content. The `UseEscapedPathForMatching=true` variant is lower severity because it requires a non-default router configuration. ## Affected versions Tested vulnerable: - `github.com/labstack/echo/v5` v5.2.0 - Current `master` at `5786024ea4d85c01784796e8aa7aac53e007b39b` No patched version is currently known. ## Policy and version checks GitHub Private Vulnerability Reporting is enabled for `labstack/echo`. The repository has a root `SECURITY.md` and accepts security reports through GitHub Security Advisories. The vulnerable code was revalidated on both current `master` and the latest release tag: - Current `master`: `5786024ea4d85c01784796e8aa7aac53e007b39b` - Latest release: `v5.2.0`, published June 14 2026 - Package: `github.com/labstack/echo/v5` The same focused Go tests pass on the checked out `v5.2.0` / `master` commit, proving the bypass remains present in the latest released version and latest main branch at the time of reporting. ## Reproduction The following application shape reproduces the high-severity bypass: ```go e := echo.New() g := e.Group("/admin", func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { return echo.NewHTTPError(http.StatusForbidden) } }) g.GET("/*", handler) e.StaticFS("/", fsysWithAdminSecret) ``` Control request: ```http GET /admin/secret.txt ``` Observed result: ```text 403 Forbidden ``` Bypass request: ```http GET /public/%2E%2E/admin/secret.txt ``` Observed result: ```text 200 OK TOP-SECRET ``` For the non-default router variant: ```go e := echo.New() e.router = echo.NewRouter(echo.RouterConfig{ UseEscapedPathForMatching: true, }) g := e.Group("/admin", authMiddlewareReturning403) g.GET("/*", handler) e.StaticFS("/", fsysWithAdminSecret) ``` Bypass request: ```http GET /public%2F..%2Fadmin%2Fsecret.txt ``` Observed result: ```text 200 OK TOP-SECRET ``` ## Proof of concept evidence I added focused tests against the current Echo codebase. The tests exercise both `StaticDirectoryHandler` and the static middleware path. Command: ```bash go test -run TestHostile -v ./... ``` Observed result: ```text === RUN TestHostile_StaticDirectoryHandler_EncodedSeparatorsBlocked --- PASS: TestHostile_StaticDirectoryHandler_EncodedSeparatorsBlocked (0.00s) === RUN TestHostile_StaticDirectoryHandler_EncodedDotDotBypass --- PASS: TestHostile_StaticDirectoryHandler_EncodedDotDotBypass (0.00s) === RUN TestHostile_UseEscapedPathForMatching_Bypass --- PASS: TestHostile_UseEscapedPathForMatching_Bypass (0.00s) PASS ok github.com/labstack/echo/v5 0.013s === RUN TestHostile_StaticMiddleware_EncodedSeparatorsBlocked --- PASS: TestHostile_StaticMiddleware_EncodedSeparatorsBlocked (0.01s) === RUN TestHostile_StaticMiddleware_EncodedDotDotBypass --- PASS: TestHostile_StaticMiddleware_EncodedDotDotBypass (0.00s) === RUN TestHostile_StaticMiddleware_DisablePathUnescaping --- PASS: TestHostile_StaticMiddleware_DisablePathUnescaping (0.00s) PASS ok github.com/labstack/echo/v5/middleware 0.012s ``` The control tests also confirm that the new fix blocks encoded separators such as `%2F`, `%5C`, double-encoded slash values, null bytes, and overlong slash encodings. ## Root cause The fix for GHSA-vfp3 uses a denylist-style guard that checks for encoded path separators before unescaping the static wildcard. This blocks `%2F` and `%5C`, but does not block encoded traversal segments such as `%2E%2E`. The vulnerable flow is: 1. The static route wildcard accepts `public/%2E%2E/admin/secret.txt`. 2. The encoded-separator guard sees no `%2F` or `%5C` and allows the request. 3. The handler unescapes the wildcard to `public/../admin/secret.txt`. 4. `path.Clean` resolves it to `admin/secret.txt`. 5. The file is served through the public static route instead of the protected `/admin/*` route. For `UseEscapedPathForMatching=true`, the router decodes the path before the static handler sees the wildcard, so the handler cannot detect that encoded separators were used in the original request. ## Remediation Do not rely only on detecting encoded separators. Reject encoded traversal sequences before unescaping, and reject normalized wildcard values that cross route or static mount boundaries. Possible fixes: 1. Extend the pre-unescape guard to reject encoded dot segments such as `%2E` and `%2E%2E` in path components. 2. After unescaping, reject any wildcard where cleaning changes the path in a way that removes `.` or `..` components. 3. For `UseEscapedPathForMatching=true`, run the static-file guard against the original escaped request path before router normalization, or preserve metadata that the matched wildcard came from encoded separators. ## Patches Fixed in `github.com/labstack/echo/v5` v5.4.0 and `github.com/labstack/echo/v4` v4.16.0. The Static middleware and `StaticDirectoryHandler` (used by `Echo.Static`, `Echo.StaticFS`, `Group.Static` and `Group.StaticFS`) no longer serve paths with a `.`, `..` or empty segment, including after path unescaping. The encoded variant of the first vector (`/public/%2E%2E/admin/secret.txt`) was already fixed in v5.2.1 and v4.15.4 (GHSA-vfp3-v2gw-7wfq). ## Workarounds Put a reverse proxy in front of the application that normalizes request paths (removes dot segments and merges slashes), or keep protected files outside the served directory.
- Source published
- 28 Oct 2026 21:04:46 UTC
- Source modified
- 5 Nov 2026 23:25:51 UTC
- Saved here
- 5 Nov 2026 23:38:32 UTC
- Source terms
- GitHub Advisory Database · CC-BY-4.0
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · GitHub Advisory Database · CC-BY-4.0. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS_V3 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Publisher rating · MODERATE
osv · GO-2026-6881
PublishedEcho static file middleware route protection bypass via encoded dot-dot traversal in github.com/labstack/echo
- Source published
- 5 Nov 2026 22:54:32 UTC
- Source modified
- 5 Nov 2026 23:15:14 UTC
- Saved here
- 5 Nov 2026 23:38:32 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.