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 package | Versions | Reported by |
|---|---|---|
| syscall | before 1.23.10, from 1.24.0-0 before 1.24.4 | CVE List |
| os | before 1.23.10, from 1.24.0-0 before 1.24.4 | CVE List |
| stdlib (Go) | before 1.23.10, from 1.24.0-0 before 1.24.4 | Go Vulnerability Database |
| golang go | before 1.23.10, from 1.24.0 before 1.24.4 | NVD |
| golang (Bitnami) | before 1.23.10, from 1.24.0-0 before 1.24.4 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
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
| https://go.dev/cl/672396 | fix, issue-tracking, report | |
| https://go.dev/issue/73702 | issue-tracking, report | |
| https://groups.google.com/g/golang-announce/c/ufZ8WpEsA3A | discussion, mailing-list, web | |
| https://pkg.go.dev/vuln/GO-2025-3750 | advisory, vendor-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2025-0913 | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-0913 changed 2025-06-11 | CVE Terms of Use |
| Go Vulnerability Database | GO-2025-3750 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2025-0913 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2025-0913 changed 2026-09-08 | Apache-2.0 |