CVE-2026-25766
Received Received - Intake
Path Traversal in Echo Middleware.Static Allows Remote File Read

Publication date: 2026-02-19

Last updated on: 2026-02-23

Assigner: GitHub, Inc.

Description
Echo is a Go web framework. In versions 5.0.0 through 5.0.2 on Windows, Echo’s `middleware.Static` using the default filesystem allows path traversal via backslashes, enabling unauthenticated remote file read outside the static root. In `middleware/static.go`, the requested path is unescaped and normalized with `path.Clean` (URL semantics). `path.Clean` does not treat `\` as a path separator, so `..\` sequences remain in the cleaned path. The resulting path is then passed to `currentFS.Open(...)`. When the filesystem is left at the default (nil), Echo uses `defaultFS` which calls `os.Open` (`echo.go:792`). On Windows, `os.Open` treats `\` as a path separator and resolves `..\`, allowing traversal outside the static root. Version 5.0.3 fixes the issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-19
Last Modified
2026-02-23
Generated
2026-06-16
AI Q&A
2026-02-19
EPSS Evaluated
2026-06-15
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
labstack echo From 5.0.0 (inc) to 5.0.3 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 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.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability exists in the Echo Go web framework versions 5.0.0 through 5.0.2 on Windows. It involves the middleware.Static component using the default filesystem, which allows path traversal via backslashes. The issue arises because the requested path is unescaped and normalized using path.Clean, which follows URL semantics and does not treat backslashes as path separators. As a result, sequences like "..\" remain in the cleaned path. When this path is passed to the filesystem's Open method, on Windows, os.Open treats backslashes as path separators and resolves "..\" sequences, allowing an attacker to read files outside the intended static root directory without authentication.

This vulnerability was fixed in version 5.0.3 of Echo.

Impact Analysis

This vulnerability allows an unauthenticated remote attacker to perform path traversal and read arbitrary files outside the intended static root directory on a Windows system running vulnerable versions of the Echo framework. This can lead to unauthorized disclosure of sensitive files, potentially exposing configuration files, source code, or other sensitive data.

Compliance Impact

I don't know

Detection Guidance

I don't know

Mitigation Strategies

To mitigate this vulnerability, upgrade the Echo web framework to version 5.0.3 or later, where the issue has been fixed.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-25766. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart