CVE-2026-118654
Echo static file middleware route protection bypass via encoded dot-dot traversal
Echo 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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.9
Echo static file middleware route protection bypass via encoded dot-dot traversal
Echo 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.
- Record
CVE-2026-118654- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-03
EUVDEUVD-2026-112459
5.9
Echo 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.
- Record
EUVD-2026-112459- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-3pmx-cf9f-34xr
5.9
Echo static file middleware route protection bypass via encoded dot-dot traversal
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/v5v5.2.0- Current
masterat5786024ea4d85c01784796e8aa7aac53e007b39b
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:
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:
GET /admin/secret.txt
Observed result:
403 Forbidden
Bypass request:
GET /public/%2E%2E/admin/secret.txt
Observed result:
200 OK
TOP-SECRET
For the non-default router variant:
e := echo.New()
e.router = echo.NewRouter(echo.RouterConfig{
UseEscapedPathForMatching: true,
})
g := e.Group("/admin", authMiddlewareReturning403)
g.GET("/*", handler)
e.StaticFS("/", fsysWithAdminSecret)
Bypass request:
GET /public%2F..%2Fadmin%2Fsecret.txt
Observed result:
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:
go test -run TestHostile -v ./...
Observed result:
=== 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…
- Record
GHSA-3pmx-cf9f-34xr- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
5.9
Echo 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.
- Record
CVE-2026-118654- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-03
OSV
5.9
Echo static file middleware route protection bypass via encoded dot-dot traversal
Echo 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.
- Record
CVE-2026-118654- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-06
OSVDEBIAN-CVE-2026-118654
5.9
Echo 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.
- Record
DEBIAN-CVE-2026-118654- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-03
OSVGHSA-3pmx-cf9f-34xr
5.9
Echo static file middleware route protection bypass via encoded dot-dot traversal
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/v5v5.2.0- Current
masterat5786024ea4d85c01784796e8aa7aac53e007b39b
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:
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:
GET /admin/secret.txt
Observed result:
403 Forbidden
Bypass request:
GET /public/%2E%2E/admin/secret.txt
Observed result:
200 OK
TOP-SECRET
For the non-default router variant:
e := echo.New()
e.router = echo.NewRouter(echo.RouterConfig{
UseEscapedPathForMatching: true,
})
g := e.Group("/admin", authMiddlewareReturning403)
g.GET("/*", handler)
e.StaticFS("/", fsysWithAdminSecret)
Bypass request:
GET /public%2F..%2Fadmin%2Fsecret.txt
Observed result:
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:
go test -run TestHostile -v ./...
Observed result:
=== 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…
- Record
GHSA-3pmx-cf9f-34xr- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-06
OSVUBUNTU-CVE-2026-118654
5.9
Echo 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.
- Record
UBUNTU-CVE-2026-118654- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-05
OSVGO-2026-6881 No score
Echo static file middleware route protection bypass via encoded dot-dot traversal in github.com/labstack/echo
Echo static file middleware route protection bypass via encoded dot-dot traversal in github.com/labstack/echo
- Record
GO-2026-6881- Updated
- 2026-11-06
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/labstack/echo/v5Go |
before 5.4.0 | 5.4.0 |
github.com/labstack/echo/v4Go |
before 4.16.0 | 4.16.0 |
golang-github-labstack-echoDebian:12 |
All versions, plus listed versions 4.11.1-14.11.1-24.12.0-14.2.1-3 |
None known |
golang-github-labstack-echoDebian:13 |
All versions, plus listed versions 4.12.0-1 |
None known |
golang-github-labstack-echoDebian:14 |
All versions, plus listed versions 4.12.0-1 |
None known |
golang-github-labstack-echo.v2Ubuntu:20.04:LTS |
All versions, plus listed versions 2.2.0-1 |
None known |
golang-github-labstack-echo.v3Ubuntu:20.04:LTS |
All versions, plus listed versions 3.3.5-1 |
None known |
golang-github-labstack-echoUbuntu:22.04:LTS |
All versions, plus listed versions 4.2.1-2 |
None known |
golang-github-labstack-echo.v2Ubuntu:22.04:LTS |
All versions, plus listed versions 2.2.0-2 |
None known |
golang-github-labstack-echo.v3Ubuntu:22.04:LTS |
All versions, plus listed versions 3.3.10-1 |
None known |
golang-github-labstack-echoUbuntu:24.04:LTS |
All versions, plus listed versions 4.11.1-2 |
None known |
golang-github-labstack-echoUbuntu:26.10 |
All versions, plus listed versions 4.12.0-1 |
None known |
golang-github-labstack-echoUbuntu:26.04:LTS |
All versions, plus listed versions 4.12.0-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases | OSV | |
| facts | EUVD, OSV | |
| references | CVE List, NVD | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-118654 is a medium vulnerability (CVSS 5.9) in Labstack Echo, published October 28, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.35%, the 28th percentile. Fixed in github.com/labstack/echo/v5 5.4.0.
References
github.com/labstack/echo/security/advisories/GHSA-3pmx-cf9f-34xr
github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1
github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af
github.com/labstack/echo/releases/tag/v4.16.0
github.com/labstack/echo/releases/tag/v5.4.0
github.com/advisories/GHSA-3pmx-cf9f-34xr
Left out here: the rest of 2 source descriptions. The JSON record has them.