CVE-2025-0913 Inconsistent handling of O_CREATE|O_EXCL on Unix and Windows in os in syscall
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.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.23.10, 1.24.4 |
stdlib Go | All versions | 1.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.
Other vulnerabilities in Golang Go
- CVE-2020-0601 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
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.