CVE-2026-56857: Root.Mkdir(All) can follow junctions out of the root on Windows in os
Exploitation: None known · CVSS 9.8 Critical · Unauthenticated · Published 2026-10-08
Description
On Windows, when the target of Root.Mkdir or Root.MkdirAll is a junction pointing to an empty location, the operation can create a directory at the junction target even when that target is located outside the root. This only applies to operations where the last path component is a junction (path/to/junction, but not path/junction/target).
Enclave's analysis
Go's os.Root sandbox has a hole on Windows. Root.Mkdir and Root.MkdirAll can follow a junction in the last path component and create a directory outside the root. The attacker needs a junction already inside the root and an app that feeds them paths. No exploit or KEV listing, and the primitive is directory creation only. Rebuild with Go 1.26.9 or 1.27.2 if you use os.Root on Windows.
Fix
Upgrade Go standard library os (Root.Mkdir, Root.MkdirAll) to 1.26.9 / 1.27.2; Go standard library internal/syscall/windows (Mkdirat) to 1.26.9 / 1.27.2. No fixed version is listed for os, internal/syscall/windows; follow the vendor advisory.
Affected versions
| Product | Vulnerable | Fixed in |
|---|---|---|
| os | 0 before 1.26.9 | Not listed |
| os | 1.27.0-0 before 1.27.2 | Not listed |
| internal/syscall/windows | 0 before 1.26.9 | Not listed |
| internal/syscall/windows | 1.27.0-0 before 1.27.2 | Not listed |
| Go standard library os (Root.Mkdir, Root.MkdirAll) | Windows only: before 1.26.9, and 1.27.0-0 up to before 1.27.2 | 1.26.9 / 1.27.2 |
| Go standard library internal/syscall/windows (Mkdirat) | Windows only: before 1.26.9, and 1.27.0-0 up to before 1.27.2 | 1.26.9 / 1.27.2 |