GO-2026-4970

Root escape via symlink plus trailing slash in os

At a glance

Published
Updated
CVE
CVE-2026-39822
Aliases
BIT-golang-2026-39822

Description

On Unix systems, opening a file in an os.Root improperly follows symlinks to locations outside of the Root when the final path component of the a path is a symbolic link and the path ends in /. For example, 'root.Open("symlink/")' will open "symlink" even when "symlink" is a symbolic link pointing outside of the root.

Affected packages

PackageVersions
Go · stdlibintroduced 0, fixed 1.25.12, introduced 1.26.0-0, fixed 1.26.5, introduced 1.27.0-0, fixed 1.27.0-rc.2

References

Sources

SourceLicence
OSV.devCC-BY 4.0 — Go Vulnerability Database