CVE-2025-0913 Inconsistent handling of O_CREATE|O_EXCL on Unix and Windows in os in syscall

Medium 5.5 Published Updated

Inconsistent symlink handling in Go's os.OpenFile on Windows allows bypassing O_EXCL checks, potentially leading to unintended file creation or modification.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-0913?

CVE-2025-0913 is a medium-severity path traversal vulnerability in Golang Go, published on 11 Jun 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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 create a file in that location. OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

Weakness: CWE-59

Which versions are affected by CVE-2025-0913?

2 open source packages ship an affected version, including golang and stdlib. It affects 1 product.

PackageAffectedFixed in
golang BitnamiAll versions1.23.10, 1.24.4
stdlib GoAll versions1.23.10, 1.24.4

Products include Golang Go.

How do I fix CVE-2025-0913?

Upgrade golang to a fixed version for your release line: 1.23.10 or 1.24.4.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-0913 being exploited?

There is no known exploitation of CVE-2025-0913 in the wild and no public exploit code.

All Golang Go vulnerabilities

Sources

Also known as AZL-78978, AZL-98823, BELL-CVE-2025-0913, BIT-golang-2025-0913, CLEANSTART-2026-DG53336, CLEANSTART-2026-DP59961 and 61 more.

Is CVE-2025-0913 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free