Skip to main content
Vulnerability Database/CVE-2026-56857

CVE-2026-56857: Windows Path Traversal Vulnerability

CVE-2026-56857 is a path traversal flaw affecting Windows junction operations that allows directory creation outside intended root boundaries. This article covers technical details, security impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-56857 Overview

CVE-2026-56857 is a path traversal vulnerability in the Go standard library affecting the os.Root API on Windows. When Root.Mkdir or Root.MkdirAll targets a junction pointing to an empty location, the operation can create a directory at the junction target even if that target sits outside the designated root. The flaw only triggers when the last path component is a junction, such as path/to/junction, not when the junction appears mid-path. The vulnerability undermines the sandboxing guarantees that os.Root is designed to enforce, allowing attackers to write directories to locations outside the intended containment boundary. The issue is tracked as GO-2026-6604 and is classified as [CWE-1386] (Insufficient Encapsulation of Machine-Readable Data).

Critical Impact

Attackers who control junction targets inside a Go program's root can force directory creation at arbitrary filesystem locations on Windows, breaking the os.Root sandbox.

Affected Products

  • Go standard library on Windows (os package, Root.Mkdir and Root.MkdirAll)
  • Go-based applications on Windows that rely on os.Root for filesystem sandboxing
  • Server workloads processing untrusted paths or archives through Go's os.Root API

Discovery Timeline

  • 2026-10-08 - CVE-2026-56857 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-56857

Vulnerability Analysis

The Go os.Root type provides filesystem operations constrained to a specified root directory. It is intended to prevent path traversal when applications handle untrusted inputs. On Windows, Root.Mkdir and Root.MkdirAll fail to correctly resolve the final path component when that component is a junction pointing to an empty location. Rather than rejecting the operation or treating the junction as a boundary, the Go runtime follows the junction and creates the directory at the junction's target. Because junctions on Windows can point anywhere on the filesystem, this allows directory creation outside the sandbox.

Root Cause

The defect lies in how the Windows implementation of Root.Mkdir resolves the terminal path component. The code validates intermediate path segments but does not re-validate the final segment after junction resolution during directory creation. When the junction target is empty, the MkdirAll logic treats the location as a valid creation point and writes outside the root. The vulnerability is a form of time-of-check to time-of-use (TOCTOU) ordering gap specific to junction handling and is categorized under [CWE-1386].

Attack Vector

Exploitation requires an attacker to either place or influence a junction inside the Go program's declared root directory, with the junction pointing to an attacker-chosen location outside the root. The attacker then triggers the application to call Root.Mkdir or Root.MkdirAll with the junction as the final path component. Typical scenarios include archive extraction utilities, file upload handlers, build systems, and multi-tenant services that process untrusted directory structures. The attacker gains the ability to create directories in arbitrary filesystem paths accessible to the Go process. See the Go.dev change list and the Go issue tracker entry for the patch details.

No verified exploit code is published. Refer to the Golang announcement and the GO-2026-6604 advisory for authoritative technical context.

Detection Methods for CVE-2026-56857

Indicators of Compromise

  • Unexpected directories created outside application working directories on Windows hosts running Go-based services
  • Junction reparse points inside user-writable directories that target sensitive filesystem locations such as C:\Windows, C:\ProgramData, or service configuration paths
  • Go binaries invoking Root.Mkdir or Root.MkdirAll during handling of untrusted archives or user-supplied path inputs

Detection Strategies

  • Inventory Windows hosts for Go binaries and identify those linked against Go toolchain versions prior to the fixed releases referenced in the Go announcement.
  • Scan filesystem write events for MkdirEx or CreateDirectory calls originating from Go processes that resolve to paths outside expected application roots.
  • Audit source code for uses of os.Root.Mkdir and os.Root.MkdirAll and verify that junction-aware input validation is applied upstream.

Monitoring Recommendations

  • Enable Windows Sysmon Event ID 11 (FileCreate) and Event ID 2 (FileCreationTimeChanged) and correlate directory creation events with Go process ancestors.
  • Monitor creation of NTFS reparse points inside tenant-writable directories using Windows audit policy Audit Object Access.
  • Alert on Go process writes to filesystem locations outside their declared working directory tree.

How to Mitigate CVE-2026-56857

Immediate Actions Required

  • Upgrade Go to the patched release listed in the Golang announcement for GO-2026-6604 and rebuild all affected Windows binaries.
  • Audit application code paths that pass untrusted input to Root.Mkdir or Root.MkdirAll and reject paths whose final component is a reparse point.
  • Remove or quarantine existing junctions inside directories that Go services treat as sandbox roots on Windows.

Patch Information

The fix is tracked in Go CL 847305 and documented in Go issue 81739. Rebuild and redeploy any Windows binaries compiled with vulnerable Go toolchains. The advisory GO-2026-6604 lists affected and fixed module versions.

Workarounds

  • Pre-validate untrusted path inputs on Windows by resolving reparse points with GetFinalPathNameByHandle and rejecting paths that escape the intended root.
  • Run Go services under least-privileged Windows accounts that cannot write to sensitive system directories, limiting the blast radius of out-of-root directory creation.
  • Disable creation of reparse points for untrusted users by removing the SeCreateSymbolicLinkPrivilege from non-administrative accounts.
bash
# Verify installed Go version on Windows and upgrade if vulnerable
go version

# Remove SeCreateSymbolicLinkPrivilege from a non-admin account (PowerShell as admin)
# Edit via secpol.msc: Local Policies > User Rights Assignment > Create symbolic links

# Scan a directory tree for junctions before passing paths to Go services
fsutil reparsepoint query C:\path\to\tenant\root

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.