CVE-2025-0913
MediumSummary
The vulnerability in the os.OpenFile implementation in Go causes different behavior on Unix and Windows systems when the target path is a dangling symlink. On Unix, the O_EXCL flag prevents following symlinks, while on Windows the function may follow the symlink to a nonexistent location.
Risk Assessment
The risk involves potential bypass of security mechanisms that rely on atomic file creation with the O_EXCL flag. An attacker on Windows could exploit a dangling symlink to create a file in an unexpected location, potentially leading to privilege escalation or data integrity violation.
Recommendation
It is recommended to update to a Go version that includes the fix for CVE-2025-0913. Also review code using os.OpenFile with O_CREATE and O_EXCL flags on Windows systems and consider additional safeguards such as explicit path type checking.
Original NVD description (English source)
os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would

