CVE-2026-42574: Go Sanitize Path Symlink Following Traversal

A path returned by a `sanitizePath`-style helper (lexical-only cleaning that does not resolve symlinks) flows into a symlink-following stdlib filesystem call (os.WriteFile / os.MkdirAll / os.Symlink / os.Link / os.OpenFile / etc.). A pre-existing or attacker-planted symlink under the base directory can redirect the resulting kernel pathname resolution outsid

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0Go
greprules fetch cve-2026-42574-go-sanitize-path-symlink-following-traversal --engine opengrep

Description

A path returned by a `sanitizePath`-style helper (lexical-only cleaning that does not resolve symlinks) flows into a symlink-following stdlib filesystem call (os.WriteFile / os.MkdirAll / os.Symlink / os.Link / os.OpenFile / etc.). A pre-existing or attacker-planted symlink under the base directory can redirect the resulting kernel pathname resolution outsid