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.
{
"review_status": "REVIEWED",
"url": "https://pkg.go.dev/vuln/GO-2025-3750"
}{
"imports": [
{
"symbols": [
"Open"
],
"path": "syscall",
"goos": [
"windows"
]
},
{
"symbols": [
"Chdir",
"Chmod",
"Chown",
"CopyFS",
"Create",
"CreateTemp",
"File.ReadDir",
"File.Readdir",
"File.Readdirnames",
"Getwd",
"Lchown",
"Link",
"Lstat",
"Mkdir",
"MkdirAll",
"MkdirTemp",
"NewFile",
"Open",
"OpenFile",
"OpenInRoot",
"OpenRoot",
"Pipe",
"ReadDir",
"ReadFile",
"Remove",
"RemoveAll",
"Rename",
"Root.Create",
"Root.Lstat",
"Root.Mkdir",
"Root.Open",
"Root.OpenFile",
"Root.OpenRoot",
"Root.Remove",
"Root.Stat",
"StartProcess",
"Stat",
"Symlink",
"Truncate",
"WriteFile",
"dirFS.Open",
"dirFS.ReadDir",
"dirFS.ReadFile",
"dirFS.Stat",
"rootFS.Open",
"rootFS.ReadDir",
"rootFS.ReadFile",
"rootFS.Stat",
"unixDirent.Info"
],
"path": "os",
"goos": [
"windows"
]
}
]
}