CVE-2026-27139

FileInfo can escape from a Root in os

Published Mar 6, 2026 CVSS 3.1 · 2.5 Low EPSS < 1% KEV · Not listed
Description
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 in which the File was opened. The impact of this escape is limited to reading metadata provided by lstat from arbitrary locations on the filesystem without permitting reading or writing files outside the root.

Analysis

AI-generated

Technical impact

This vulnerability allows the FileInfo object returned by File.ReadDir or File.Readdir on Unix systems to reference a file outside of the directory’s initial root. As a result, an application can obtain limited metadata about arbitrary files through the operating system’s lstat system call, but cannot read or write those files. The weakness stems from insufficient path validation and is classified as CWE-22, a path traversal issue.

Affected Systems

Affected vendors include the Go standard library (product os). The flaw is present in Go releases that have not yet applied the related fix. No specific version list is provided, so all Go versions prior to the patch are considered vulnerable when running on Unix platforms.

Risk and Exploitability

The CVSS score of 2.5 indicates a low severity issue, and an EPSS score of less than 1% reflects a very low likelihood of exploitation in the wild. The flaw has not been listed in the CISA KEV catalog. Exploitation is possible only from within the same host and requires that an attacker can influence or observe a process performing directory reads. While no remote code execution or data exfiltration is gained, the ability to learn sensitive file metadata could aid in further attacks.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a Go release that contains the fixed FileInfo root check.
  • Restrict the use of File.ReadDir and File.ReadDir to directories that are verified to be within trusted paths, or add additional path validation before processing the returned FileInfo objects.
  • Run any applications that process untrusted directories with the minimum necessary privileges, limiting their ability to access files outside the intended directory tree.

Generated by OpenCVE AI on April 16, 2026 at 11:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Golang
Golang go
CPEs cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
cpe:2.3:a:golang:go:1.26.0:*:*:*:*:*:*:*
Vendors & Products Golang
Golang go
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 2.5, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Go Standard Library
Go Standard Library os
Vendors & Products Go Standard Library
Go Standard Library os
Type Values Removed Values Added
Description 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 in which the File was opened. The impact of this escape is limited to reading metadata provided by lstat from arbitrary locations on the filesystem without permitting reading or writing files outside the root.
Title FileInfo can escape from a Root in os
References
Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Nov 23, 2026, 8:27 PM
Reserved
Feb 17, 2026, 7:57 PM
Status
Analyzed
Published
Mar 6, 2026, 10:16 PM
Modified
Nov 23, 2026, 9:17 PM
Severity
Low
Public date
Mar 6, 2026, 9:28 PM