CVE-2025-0913

Inconsistent handling of O_CREATE|O_EXCL on Unix and Windows in os in syscall

Published Jun 11, 2025 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2025-18139 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.
History
Type Values Removed Values Added
First Time appeared Golang
Golang go
Microsoft
Microsoft windows
Weaknesses CWE-59
CPEs cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*
Vendors & Products Golang
Golang go
Microsoft
Microsoft windows
Type Values Removed Values Added
Metrics epss

{'score': 0.00013}

epss

{'score': 0.00015}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Inconsistent handling of O_CREATE|O_EXCL on Unix and Windows in os in syscall
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Jun 11, 2025, 5:37 PM
Reserved
Jan 30, 2025, 9:52 PM
Status
Analyzed
Published
Jun 11, 2025, 6:15 PM
Modified
Jun 17, 2026, 8:27 AM