CVE-2026-27139
Directory Traversal in Go File.ReadDir Allows Metadata Disclosure
Publication date: 2026-03-06
Last updated on: 2026-04-21
Assigner: Go Project
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| golang | go | to 1.25.8 (exc) |
| golang | go | 1.26.0 |
Helpful Resources
Exploitability
| 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 Powered Q&A
Can you explain this vulnerability to me?
On Unix platforms, when listing the contents of a directory using File.ReadDir or File.Readdir, the returned FileInfo could reference a file outside of the root directory in which the File was opened.
This means that the directory listing can escape the intended root directory and include metadata about files located elsewhere on the filesystem.
However, this escape is limited to reading metadata provided by lstat and does not allow reading or writing the actual file contents outside the root.
How can this vulnerability impact me? :
This vulnerability allows an attacker or user to obtain metadata information about files outside the intended root directory when listing directory contents.
While it does not permit reading or writing the actual file contents outside the root, the exposure of metadata could potentially reveal sensitive information such as file existence, permissions, or timestamps.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
I don't know
What immediate steps should I take to mitigate this vulnerability?
I don't know