CVE-2025-0913
NoneCVSS
—
EPSS
0.3%
Published
Jun 11, 2025
CISA due date
—
Cloudanix analysis
A flaw in how some software applications create files on Windows systems could be exploited by an attacker to place a file in an unintended, sensitive location, potentially leading to a system compromise.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Library
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The os.OpenFile function in Go exhibits inconsistent behavior between Unix and Windows systems when handling dangling symbolic links with O_CREATE and O_EXCL flags. On a vulnerable Windows system, if the path provided to OpenFile is a symbolic link to a non-existent location, the function will create a file at the target of the symlink. This allows an attacker to control the location where a file is created, potentially bypassing file system access controls and writing a file outside of the intended directory.
Why it matters to the business
This vulnerability can lead to unauthorized file creation in sensitive system locations, which could result in privilege escalation, denial of service, or arbitrary code execution. An attacker could overwrite critical system files, place malicious scripts in startup directories, or fill up disk space in critical partitions. This compromises system integrity and availability, potentially leading to a full system takeover and disruption of business operations.
How an attack unfolds
An attacker with low-privilege access to a Windows machine first identifies a Go application that uses the vulnerable os.OpenFile function to create files (e.g., lock files or temporary files) in a predictable location. The attacker then creates a symbolic link at this predictable location, pointing to a sensitive destination path where the attacker does not have direct write permissions (e.g., C:\Windows\System32). When the legitimate Go application executes and attempts to create its file, the vulnerable function on Windows follows the attacker's symbolic link and creates the file in the sensitive destination directory. If the application writes executable content or configuration data to this file, the attacker could achieve privilege escalation or code execution.
How to fix it
The primary remediation is to update the Go language distribution and recompile affected applications. Developers should ensure their build environments use a Go version that includes the fix (commit d375ae50633cdf1cd8536f2a199c382f9053b638 or later). For systems running pre-compiled software like Jenkins, upgrade to a patched version, such as Jenkins Chainguard image 2.492.3-r4 or newer. If immediate patching is not feasible, restrict permissions in directories where applications create temporary files to prevent unauthorized users from creating symbolic links.
How to confirm the fix worked
To validate the fix, verify that all Go applications are compiled with a patched version of the Go compiler. On Windows systems, you can create a test Go program that uses `os.OpenFile` with `O_CREATE|O_EXCL` on a path that is a dangling symlink. On a vulnerable system, the file will be created at the symlink's target. On a patched system, the function call will return an error. Security teams should audit application inventories to identify software built with Go and confirm their build versions.
Typical attack path
- An attacker gains initial low-privilege access to a target Windows system.
- The attacker identifies a Go-based application that performs file creation using the vulnerable `os.OpenFile` call.
- The attacker creates a symbolic link from the application's expected file path to a privileged or sensitive directory.
- The attacker waits for or triggers the vulnerable application to perform the file creation operation.
- The application follows the symlink and creates a file in the attacker-chosen sensitive location, leading to a security bypass or privilege escalation.
How to detect it
Exploitation of this vulnerability requires an attacker to first create a symbolic link. Security teams should monitor for the creation of symbolic links on Windows endpoints, especially in directories used by Go applications for temporary file storage. Look for command-line activity involving `mklink` or PowerShell's `New-Item -ItemType SymbolicLink`. Correlate this activity with subsequent anomalous file creation events by Go application processes in unexpected directories. Endpoint Detection and Response (EDR) logs and Windows Security Event Logs (ID 4688 for process creation, and file access auditing) are key data sources.
- cmd.exe /c mklink
- powershell.exe New-Item -ItemType SymbolicLink
What your security team should do
- Immediately patch all Go development and build environments to a non-vulnerable version to prevent the creation of new vulnerable software.
- Inventory all Go-based applications running on Windows hosts and prioritize them for recompilation or updates.
- Apply vendor-supplied patches for affected third-party software, such as Jenkins, as soon as they are available.
- As a compensating control, implement file system monitoring to detect and alert on the creation of symbolic links in unusual locations or by unauthorized users.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Go | stdlib | 0 | 1.23.10 |
| Bitnami | golang | 0 | 1.23.10 |
| Bitnami | golang | 0 | 1.24.0 |
| Chainguard | go-1.20 | 0 | 1.20.14-r9 |
| Chainguard | go-1.20-doc | 0 | 1.20.14-r9 |
| Chainguard | go-1.22 | 0 | 1.22.12-r8 |
| Chainguard | go-1.22-doc | 0 | 1.22.12-r8 |
| Chainguard | newrelic-fluent-bit-output | 0 | 2.4.0-r5 |
| Chainguard | newrelic-fluent-bit-output-compat | 0 | 2.4.0-r5 |
| Chainguard | nvidia-nsight-compute-12.8 | 0 | 2025.1.1.2-r7 |
| Chainguard | nvidia-nsight-compute-12.9 | 0 | 2025.2.1.3-r5 |
| Chainguard | nvidia-nsight-compute-13.0 | 0 | 2025.3.0.19-r2 |
| Chainguard | nvidia-nsight-compute-13.1 | 0 | 2025.4.1.2-r0 |
| Mageia:9 | golang | 0 | 1.24.4-1.mga9 |
| SUSE:Enterprise Storage 7.1 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Enterprise Storage 7.1 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | go1.23-openssl | 0 | 1.23.12-150600.13.9.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | go1.24-openssl | 0 | 1.24.6-150600.13.9.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP7 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP7 | go1.23-openssl | 0 | 1.23.12-150600.13.9.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP7 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP7 | go1.24-openssl | 0 | 1.24.6-150600.13.9.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| Wolfi | go-1.20 | 0 | 1.20.14-r9 |
| Wolfi | go-1.20-doc | 0 | 1.20.14-r9 |
| Wolfi | go-1.22 | 0 | 1.22.12-r8 |
| Wolfi | go-1.22-doc | 0 | 1.22.12-r8 |
| Wolfi | newrelic-fluent-bit-output | 0 | 2.4.0-r5 |
| Wolfi | newrelic-fluent-bit-output-compat | 0 | 2.4.0-r5 |
| openSUSE:Leap 15.6 | go1.23 | 0 | 1.23.10-150000.1.34.1 |
| openSUSE:Leap 15.6 | go1.23-openssl | 0 | 1.23.12-150600.13.9.1 |
| openSUSE:Leap 15.6 | go1.24 | 0 | 1.24.4-150000.1.26.1 |
| openSUSE:Leap 15.6 | go1.24-openssl | 0 | 1.24.6-150600.13.9.1 |
| openSUSE:Tumbleweed | go1.23 | 0 | 1.23.10-1.1 |
| openSUSE:Tumbleweed | go1.24 | 0 | 1.24.4-1.1 |
| openSUSE:Tumbleweed | govulncheck-vulndb | 0 | 0.0.20250612T141001-1.1 |
| openSUSE:Tumbleweed | kubecolor | 0 | 0.5.2-1.1 |
Related vulnerabilities
- CVE-2025-68121 During session resumption in crypto/tls, if the underlying Config has its ClientCAs or… Also affects stdlib
- CVE-2025-22873 It was possible to improperly access the parent directory of an os.Root by opening a… Also affects stdlib
- GO-2026-4403 Improper access to parent directory of root in os Also affects stdlib
- CVE-2025-61726 The net/url package does not set a limit on the number of query parameters in a query. Also affects stdlib
- CVE-2025-61728 archive/zip uses a super-linear file name indexing algorithm that is invoked the first… Also affects stdlib
- CVE-2025-61730 During the TLS 1.3 handshake if multiple messages are sent in records that span… Also affects stdlib
- CVE-2025-61727 An excluded subdomain constraint in a certificate chain does not restrict the usage of… Also affects stdlib
- CVE-2025-61729 Within HostnameError.Error(), when constructing an error string, there is no limit to the… Also affects stdlib