Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/labstack/echo/v5
  4. ›
  5. CVE-2026-118654

CVE-2026-118654: Echo static file middleware route protection bypass via encoded dot-dot traversal

October 28, 2026

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.

References

  • github.com/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/labstack/echo/security/advisories/GHSA-3pmx-cf9f-34xr
  • nvd.nist.gov/vuln/detail/CVE-2026-118654

Code Behaviors & Features

Detect and mitigate CVE-2026-118654 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 5.4.0

Fixed versions

  • 5.4.0

Solution

Upgrade to version 5.4.0 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

go/github.com/labstack/echo/v5/CVE-2026-118654.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 30 Oct 2026 12:15:42 +0000.