CVE-2025-0913
JSON

5.5medium

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

Severity
5.5medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.33% (higher than 27% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Go
Also known as
GO-2025-3750BIT-GOLANG-2025-0913

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.

Affected

Product or packageVersionsReported by
syscallbefore 1.23.10, from 1.24.0-0 before 1.24.4CVE List
osbefore 1.23.10, from 1.24.0-0 before 1.24.4CVE List
stdlib (Go)before 1.23.10, from 1.24.0-0 before 1.24.4Go Vulnerability Database
golang gobefore 1.23.10, from 1.24.0 before 1.24.4NVD
golang (Bitnami)before 1.23.10, from 1.24.0-0 before 1.24.4Bitnami Vulnerability Database

All scores

CISA-ADP5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-59

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

os.OpenFile(path, os.O_CREATE|O_EXCL) se comportaba de forma diferente en sistemas Unix y Windows cuando la ruta de destino era un enlace simbólico pendiente. En sistemas Unix, OpenFile con los indicadores O_CREATE y O_EXCL nunca sigue enlaces simbólicos. En Windows, cuando la ruta de destino era un enlace simbólico a una ubicación inexistente, OpenFile creaba un archivo en esa ubicación. OpenFile ahora siempre devuelve un error cuando los indicadores O_CREATE y O_EXCL están activados y la ruta de destino es un enlace simbólico.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-0913 changed 2025-06-11CVE Terms of Use
Go Vulnerability DatabaseGO-2025-3750 changed 2026-02-04CC-BY-4.0
NVDCVE-2025-0913 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2025-0913 changed 2026-09-08Apache-2.0