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

Published Jun 5, 2025
·
Updated

os.OpenFile(path, os.OCREATE|OEXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with OCREATE and OEXCL 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 OCREATE and OEXCL flags are both set and the target path is a symlink.

Affected Software

5 affected components
go Go
All of the following
Any of the following
Golang Go<1.23.10
Golang Go>=1.24.0<1.24.4
Microsoft Windows
IBM Netezza Software<=11.3.0.3-IF2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.24.4Patch CVE-2025-4673
  2. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.24.4Patch CVE-2025-0913
  3. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.24.4Patch CVE-2025-22874
  4. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.23.10Patch CVE-2025-4673
  5. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.23.10Patch CVE-2025-0913
  6. Upgrade

    Upgrade golang/go to a version that resolves this vulnerability.

    Fixed in 1.23.10Patch CVE-2025-22874
  7. Configuration

    After upgrading to the fixed Go versions, OpenFile must always return an error when both O_CREATE and O_EXCL are set and the target path is a symlink (including dangling symlinks), eliminating inconsistent Unix/Windows behavior.

    Go os.OpenFile (os package) Behavior when using os.O_CREATE|os.O_EXCL on symlink path = Return an error instead of creating a file

Event History

Jun 11, 2025
CVE Published
via MITRE·05:17 PM
Data Sourced
via MITRE·05:17 PM
DescriptionWeakness
Data Sourced
via NVD·06:15 PM
DescriptionSeverityWeaknessAffected Software
Aug 20, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2025-0913?

CVE-2025-0913 has a medium severity rating due to its implications on file operations across different operating systems.

2

How do I fix CVE-2025-0913?

To fix CVE-2025-0913, ensure your Go application properly handles symlinks across different operating systems.

3

What platforms are affected by CVE-2025-0913?

CVE-2025-0913 affects applications running on both Unix and Windows operating systems.

4

What are the implications of CVE-2025-0913?

The implications of CVE-2025-0913 include potential file handling errors when working with dangling symlinks.

5

Which version of Go is vulnerable to CVE-2025-0913?

CVE-2025-0913 impacts specific versions of the Go programming language that utilize the os.OpenFile function.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203