{"id":"CVE-2026-118655","aliases":["GHSA-xwq5-6cqp-vx96"],"title":"Echo has a Static Middleware Double-Unescape Path Traversal","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"## Summary\n\nCommit a9ede66a (PR #3006, issue #2599) silently fixed a path traversal vulnerability in the Echo web framework's static file middleware.\n\n## Vulnerability\n\nThe static middleware double-unescaped URL paths. Go's net/http already decodes Request.URL.Path, but middleware/static.go unconditionally called url.PathUnescape() again:\n\n```go\n// BEFORE (vulnerable)\npathUnescape := true\n```\n\nThis reassembled path traversal sequences from double-encoded input. An attacker could send GET /%2e%2e%2fsecret.txt or /..%252fsecret.txt and the double-unescape would produce ../secret.txt.\n\n## Fix\n```go\n// AFTER (fixed)\npathUnescape := false\n```\n\nThe commit's test TestStatic_percentEncodedTraversalIsBlocked explicitly verifies traversal vectors are blocked.\n\n## Impact\nArbitrary file read from server filesystem via percent-encoded path traversal.\n\n## References\n- Fix: https://github.com/labstack/echo/commit/a9ede66a\n- Issue: https://github.com/labstack/echo/issues/2599\n- PR: https://github.com/labstack/echo/pull/3006\n\n## Patches\n\nFixed in `github.com/labstack/echo/v5` v5.2.0 and `github.com/labstack/echo/v4` v4.15.3, where the Static middleware stopped unescaping an already decoded path. Maintainer analysis: reading files outside the configured root could not be reproduced; the confirmed impact was that a double-encoded slash (`%252F`) could reach a file under a guarded route when the Static middleware is registered globally. Upgrade to v5.4.0 / v4.16.0 or later, which also includes related fixes for encoded and dot-segment paths.\n\n## Workarounds\n\nKeep files that need protection outside the Static middleware's root directory.","severity":"medium","score":5.9,"published":"2026-10-28T20:03:56.897Z","modified":"2026-10-29T18:29:50.622Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Go","name":"github.com/labstack/echo/v5","sources":[{"name":"OSV · GHSA-xwq5-6cqp-vx96","url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"5.2.0"}],"type":"SEMVER"}],"versions":[],"fixed":["5.2.0"]},{"ecosystem":"Go","name":"github.com/labstack/echo/v4","sources":[{"name":"OSV · GHSA-xwq5-6cqp-vx96","url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"4.15.3"}],"type":"SEMVER"}],"versions":[],"fixed":["4.15.3"]}],"sourceAffected":[],"references":["https://github.com/labstack/echo/security/advisories/GHSA-xwq5-6cqp-vx96","https://github.com/labstack/echo/issues/2599","https://github.com/labstack/echo/pull/3006","https://github.com/labstack/echo/commit/a9ede66a5a7196411131beb1ee801e75bbaf7ac6","https://github.com/labstack/echo/commit/c3fa2a27ff92b2b8db360de614f999ef1da24725","https://github.com/labstack/echo","https://github.com/labstack/echo/releases/tag/v4.15.3","https://github.com/labstack/echo/releases/tag/v5.2.0"],"sources":[{"name":"OSV","id":"GHSA-xwq5-6cqp-vx96","modified":"2026-10-28T21:15:04.922261839Z","url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96"},{"name":"CVE","id":"CVE-2026-118655","modified":"2026-10-29T18:29:50.622Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-118655"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9},{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9}],"cve":{"records":[{"id":"CVE-2026-118655","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-10-28T17:25:37.561Z","published":"2026-10-28T20:03:56.897Z","modified":"2026-10-29T18:29:50.622Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-10-28T20:03:56.897Z"},{"name":"CISA-ADP","role":"ADP","organizationId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","modified":"2026-10-29T18:29:50.622Z"}],"references":[{"url":"https://github.com/labstack/echo/security/advisories/GHSA-xwq5-6cqp-vx96","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/issues/2599","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/pull/3006","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/commit/a9ede66a5a7196411131beb1ee801e75bbaf7ac6","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/commit/c3fa2a27ff92b2b8db360de614f999ef1da24725","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/releases/tag/v4.15.3","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/releases/tag/v5.2.0","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-174","description":"CWE-174: Double Decoding of the Same Data","source":"GitHub_M"}],"applicability":[],"prioritization":[{"source":"CISA-ADP","type":"SSVC","role":"CISA Coordinator","timestamp":"2026-10-29T18:29:35.386733Z","decisions":[{"name":"Exploitation","value":"none"},{"name":"Automatable","value":"no"},{"name":"Technical Impact","value":"partial"}]}]},"products":[{"vendor":"labstack","name":"echo","platforms":[],"versions":[{"version":">= 5.0.0, < 5.2.0","status":"affected"},{"version":"< 4.15.3","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-118655"}],"remediation":[],"observedAt":"2026-10-29T18:49:09.647Z","kev":{"status":"not-listed","checkedAt":"2026-10-31T01:55:30.764Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-10-28T22:00:30.890Z","attemptedAt":"2026-10-28T22:00:30.890Z"},{"source":"GHSA","status":"available","checkedAt":"2026-10-28T22:00:32.215Z","attemptedAt":"2026-10-28T22:00:32.215Z"},{"source":"EUVD","status":"available","checkedAt":"2026-10-28T22:00:30.985Z","attemptedAt":"2026-10-28T22:00:30.985Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-10-28T22:00:32.215Z","attemptedAt":"2026-10-28T22:00:32.215Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-118655","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118655","modified":"2026-10-28T20:17:22.723","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","checkedAt":"2026-10-28T22:00:30.890Z"},{"source":"ENISA EUVD","id":"EUVD-2026-112461","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-112461","modified":"Oct 28, 2026, 8:03:56 PM","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","checkedAt":"2026-10-28T22:00:30.985Z"},{"source":"GitHub Advisory Database","id":"GHSA-xwq5-6cqp-vx96","url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","modified":"2026-10-28T21:04:40Z","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","checkedAt":"2026-10-28T22:00:32.215Z"}],"aiSummary":null}