---
id: "CVE-2026-56857"
kind: "vulnerability"
aliases: ["CVE-2026-56857", "GO-2026-6604"]
title: "Root.Mkdir(All) can follow junctions out of the root on Windows in os"
severity: "critical"
cvss: 9.8
epss: 0.00493
exploited: false
status: "open"
category: "runtime"
products: [{"name": "stdlib", "fixed": ["1.26.9", "1.27.2"], "affected": ">= 1.27.0-0, < 1.27.2", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["go", "os.root", "runtime", "self-hosted", "windows"]
not_affected_if: ["go-below-1.27.0-or-patched", "no-os.root-mkdir-use", "non-windows-hosts", "paths-not-attacker-influenced"]
published_at: "2026-10-08T22:31:09+00:00"
first_seen_at: "2026-10-23T19:13:08+00:00"
updated_at: "2026-10-23T19:50:58+00:00"
sources: [{"source": "govuln", "url": "https://pkg.go.dev/vuln/GO-2026-6604", "first_seen_at": "2026-10-23T19:13:08+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-56857", "first_seen_at": "2026-10-23T19:13:43+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-56857", "first_seen_at": "2026-10-23T19:35:23+00:00"}]
---

# Root.Mkdir(All) can follow junctions out of the root on Windows in os

Go's os.Root Mkdir and MkdirAll on Windows can follow a junction at the final path component and create a directory at the junction's target even when that target lies outside the root. An attacker who can plant or control a junction inside the root can create directories anywhere the Go process has write access.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:stdlib affected >= 1.27.0-0, < 1.27.2 fixed 1.26.9, 1.27.2

## How to check

Find Go binaries or source modules built with go1.26.x before 1.26.9 or go1.27.x before 1.27.2 on Windows; run 'go version -m <binary>' or 'go version' to see the toolchain.
Search code for os.Root usage calling Mkdir or MkdirAll on paths that untrusted users can influence.

## Fix

Upgrade the Go toolchain to 1.26.9 or 1.27.2 and rebuild Windows binaries.

## Timeline

- 2026-10-23T19:13:08+00:00 govuln https://pkg.go.dev/vuln/GO-2026-6604
- 2026-10-23T19:13:43+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-56857
- 2026-10-23T19:35:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-56857

## From the sources

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).

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
