{"schema":"threatline.record/2","record":{"id":"CVE-2026-118655","aliases":["GHSA-xwq5-6cqp-vx96"],"summary":"Echo has a Static Middleware Double-Unescape Path Traversal","details":"## 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.","categories":["Libraries & packages"],"product":"github.com/labstack/echo/v5","vendor":"labstack","ecosystem":"go","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:04:40Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"ecosystem":"go","name":"github.com/labstack/echo/v5"},"range":"< 5.2.0"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:04:40Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"ecosystem":"go","name":"github.com/labstack/echo/v4"},"range":"< 4.15.3"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-118655","source_modified_at":"2026-10-28T20:03:56.897Z","fetched_at":"2026-10-28T20:58:01.013507Z","product":"echo","vendor":"labstack","versions":[{"status":"affected","version":">= 5.0.0, < 5.2.0"},{"status":"affected","version":"< 4.15.3"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:15:04.922261839Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"name":"github.com/labstack/echo/v5","ecosystem":"Go","purl":"pkg:golang/github.com/labstack/echo/v5"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.2.0"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:15:04.922261839Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"name":"github.com/labstack/echo/v4","ecosystem":"Go","purl":"pkg:golang/github.com/labstack/echo/v4"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.15.3"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:04:40Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"ecosystem":"go","name":"github.com/labstack/echo/v5"},"version":"5.2.0"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:04:40Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"ecosystem":"go","name":"github.com/labstack/echo/v4"},"version":"4.15.3"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:15:04.922261839Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"name":"github.com/labstack/echo/v5","ecosystem":"Go","purl":"pkg:golang/github.com/labstack/echo/v5"},"version":"5.2.0"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96","source_modified_at":"2026-10-28T21:15:04.922261839Z","fetched_at":"2026-10-29T00:48:09.584895Z","package":{"name":"github.com/labstack/echo/v4","ecosystem":"Go","purl":"pkg:golang/github.com/labstack/echo/v4"},"version":"4.15.3"}],"cvss":5.9,"severity":"Medium","kev":{"listed":false},"epss":{"probability":null,"percentile":null,"score_date":null},"published_at":"2026-10-28T20:03:56.897Z","modified_at":"2026-10-28T21:15:04.922261839Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","fetched_at":"2026-10-29T00:48:09.584895Z","source_modified_at":"2026-10-28T21:04:40Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-118655","fetched_at":"2026-10-28T20:58:01.013507Z","source_modified_at":"2026-10-28T20:03:56.897Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-xwq5-6cqp-vx96","fetched_at":"2026-10-29T00:48:09.584895Z","source_modified_at":"2026-10-28T21:15:04.922261839Z"}],"sources":["GitHub Advisory Database","CVE List","OSV"],"references":[{"source":"CVE List","url":"https://github.com/labstack/echo/security/advisories/GHSA-xwq5-6cqp-vx96","tags":["x_refsource_CONFIRM"]},{"source":"CVE List","url":"https://github.com/labstack/echo/issues/2599","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/labstack/echo/pull/3006","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/labstack/echo/commit/a9ede66a5a7196411131beb1ee801e75bbaf7ac6","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/labstack/echo/commit/c3fa2a27ff92b2b8db360de614f999ef1da24725","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/labstack/echo/releases/tag/v4.15.3","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/labstack/echo/releases/tag/v5.2.0","tags":["x_refsource_MISC"]},{"url":"https://github.com/advisories/GHSA-xwq5-6cqp-vx96","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-28T21:15:04.922261839Z","content_hash":"8a2181ae59d38369d34d857c45a87fd090402cd9ac2f300ec38848078a60399e"}}
