Vulnerabilities in pkg:golang/github.com/labstack/echo/v4

PACKAGE
Advisory Identifier: GHSA-vfp3-v2gw-7wfq
Advisory Summary

CVE-2026-55677 is a HIGH (CVSS 7.5) encoded slash (%2f) bypasses route-level vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Echo libraries in the Go ecosystem. The issue involves encoded slash (%2f) bypasses route-level protection and exposes static files. Remediation is available by upgrading affected packages to version 5.2.0, 4.15.3.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/labstack/echo/v4

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/labstack/echo/v4. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vfp3-v2gw-7wfq CVE-2026-55677 HIGH Echo: Encoded slash (%2F) bypasses route-level protection and exposes static files
GHSA-j453-hm5x-c46w CVE-2020-36565 MODERATE Echo vulnerable to directory traversal
GHSA-crxj-hrmp-4rwf CVE-2022-40083 CRITICAL Labstack Echo Open Redirect vulnerability

CVE-2026-55677 at a Glance

CVE Identifier CVE-2026-55677
GHSA Identifier GHSA-vfp3-v2gw-7wfq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Echo
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-55677

To remediate this vulnerability, upgrade all affected Echo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/labstack/echo/v5 fixed: 5.2.0
Upgrade github.com/labstack/echo/v5 to 5.2.0
github.com/labstack/echo/v4 fixed: 4.15.3
Upgrade github.com/labstack/echo/v4 to 4.15.3
github.com/labstack/echo fixed: Latest secure release
Upgrade github.com/labstack/echo to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/labstack/echo/v5

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-55677, inspect your project dependencies for Echo:

inspect dependencies for github.com/labstack/echo/v5

Analyze the terminal output to locate any version of Echo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Echo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Echo's router and static file handler disagree on URL path decoding. The router matches routes using the raw encoded path (preserving `%2F` as-is), while `StaticDirectoryHandler` unescapes `%2F` to `/` before resolving filesystem paths. This allows an attacker to bypass route-level access controls and read static files without authorization. ### Details **Root cause 1 — `router.go` lines 798-802:** The router uses `req.URL.RawPath` for route matching when `useEscapedPathForRouting` is false (the default). This means `/admin%2Fsecret.txt` is treated as a single path segment and does NOT match the `/admin/*` route pattern. ```go if !r.useEscapedPathForRouting && req.URL.RawPath != "" { path = req.URL.RawPath } ``` **Root cause 2 — `echo.go` lines 559-568:** `StaticDirectoryHandler` calls `url.PathUnescape()` on the path parameter before opening files. This converts `%2F` back to `/`, resolving `admin/secret.txt` on disk. ```go if !disablePathUnescaping { tmpPath, err := url.PathUnescape(p) p = tmpPath } name := filepath.ToSlash(filepath.Clean(strings.TrimPrefix(p, "/"))) ``` ### PoC (Screenshot) Sample: <img width="1291" height="970" alt="image" src="https://github.com/user-attachments/assets/0bc58059-3e6d-4678-ab25-a5c79b006738" /> 403: <img width="526" height="194" alt="image" src="https://github.com/user-attachments/assets/2f55ffdd-87b2-4a1b-8a13-130ebad0f257" /> Bypass with encoded slash: <img width="592" height="203" alt="image" src="https://github.com/user-attachments/assets/1191cd39-ae8f-4d7e-8fb1-cb9cf31f484f" /> ### Impact Unauthorized static file disclosure. Applications that protect route prefixes with authentication middleware while also serving static files from a broader root are vulnerable. An attacker only needs to encode the slash (`/` → `%2F`) in the URL to bypass all route-level protection. Common affected pattern: ```go adminGroup := e.Group("/admin", authMiddleware) e.StaticFS("/", os.DirFS("public")) ```

CVE-2026-55677 Affected Echo Versions

3 component(s)
Fixed Versions:
5.2.04.15.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/labstack/echo/v5
Go
< 5.2.0
5.2.0
github.com/labstack/echo/v4
Go
< 4.15.3
4.15.3
github.com/labstack/echo
Go
≤ 3.3.10

References

Frequently Asked Questions

What is CVE-2026-55677?
CVE-2026-55677 is a security vulnerability in Echo involving Encoded slash (%2F) bypasses route-level protection and exposes static files under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Echo versions are affected?
Affected versions include releases prior to 5.2.0, 4.15.3 across affected packages: github.com/labstack/echo/v5, github.com/labstack/echo/v4, github.com/labstack/echo.
What version fixes CVE-2026-55677?
Upgrading to 5.2.0, 4.15.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/labstack/echo/v5 affected?
Yes, github.com/labstack/echo/v5 is affected in releases prior to 5.2.0. Upgrade your dependency to 5.2.0 or later.
Is github.com/labstack/echo/v4 affected?
Yes, github.com/labstack/echo/v4 is affected in releases prior to 4.15.3. Upgrade your dependency to 4.15.3 or later.
What is the CVSS score of CVE-2026-55677?
CVE-2026-55677 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-55677?
CVE-2026-55677 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2026-55677?
Run the dependency tree command: 'inspect dependencies for github.com/labstack/echo/v5'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vfp3-v2gw-7wfq",
  "modified" : "2026-08-25T16:13:29Z",
  "published" : "2026-08-25T16:13:29Z",
  "aliases" : [ "CVE-2026-55677" ],
  "summary" : "Echo: Encoded slash (%2F) bypasses route-level protection and exposes static files",
  "details" : "### Summary\n\nEcho's router and static file handler disagree on URL path decoding. The router matches routes using the raw encoded path (preserving `%2F` as-is), while `StaticDirectoryHandler` unescapes `%2F` to `/` before resolving filesystem paths. This allows an attacker to bypass route-level access controls and read static files without authorization.\n\n### Details\n\n**Root cause 1 — `router.go` lines 798-802:**\nThe router uses `req.URL.RawPath` for route matching when `useEscapedPathForRouting` is false (the default). This means `/admin%2Fsecret.txt` is treated as a single path segment and does NOT match the `/admin/*` route pattern.\n\n```go\nif !r.useEscapedPathForRouting && req.URL.RawPath != \"\" {\n    path = req.URL.RawPath\n}\n```\n\n**Root cause 2 — `echo.go` lines 559-568:**\n`StaticDirectoryHandler` calls `url.PathUnescape()` on the path parameter before opening files. This converts `%2F` back to `/`, resolving `admin/secret.txt` on disk.\n\n```go\nif !disablePathUnescaping {\n    tmpPath, err := url.PathUnescape(p)\n    p = tmpPath\n}\nname := filepath.ToSlash(filepath.Clean(strings.TrimPrefix(p, \"/\")))\n```\n\n### PoC (Screenshot)\nSample:\n<img width=\"1291\" height=\"970\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0bc58059-3e6d-4678-ab25-a5c79b006738\" />\n\n403:\n<img width=\"526\" height=\"194\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2f55ffdd-87b2-4a1b-8a13-130ebad0f257\" />\n\nBypass with encoded slash:\n<img width=\"592\" height=\"203\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1191cd39-ae8f-4d7e-8fb1-cb9cf31f484f\" />\n\n### Impact\n\nUnauthorized static file disclosure. Applications that protect route prefixes with authentication middleware while also serving static files from a broader root are vulnerable. An attacker only needs to encode the slash (`/` → `%2F`) in the URL to bypass all route-level protection.\n\nCommon affected pattern:\n```go\nadminGroup := e.Group(\"/admin\", authMiddleware)\ne.StaticFS(\"/\", os.DirFS(\"public\"))\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/labstack/echo/v5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/labstack/echo/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.15.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/labstack/echo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.3.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/security/advisories/GHSA-vfp3-v2gw-7wfq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-55677"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/pull/3009"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/pull/3011"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/commit/8d1ae9d3360a71672418856d58753af25f2c3986"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/commit/c3fa2a27ff92b2b8db360de614f999ef1da24725"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/labstack/echo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/releases/tag/v4.15.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labstack/echo/releases/tag/v5.2.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-25T16:13:29Z",
    "nvd_published_at" : "2026-06-26T17:16:34Z"
  }
}