CVE-2023-45283: Insecure parsing of Windows paths in filepath package
Summary
CVE-2023-45283: Insecure parsing of Windows paths with a \??\ prefix in path/filepath. Affects stdlib across 4 version ranges.
< 1.20.11
>= 1.20.11, < 1.20.12
>= 1.21.0-0, < 1.21.4
>= 1.21.4, < 1.21.5
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
- golang-1.15 · Debian:11
The same CVE-2023-45283 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The filepath package is a part of the Go standard library and provides functions for manipulating file paths. It is commonly used in Go applications to handle file and directory paths in a platform-independent manner. The package includes functions for cleaning, joining, splitting, and evaluating file paths.
However, the filepath package in versions before 1.20.11 and 1.21.4 is vulnerable to an insecure parsing issue on Windows systems. This vulnerability allows an attacker to access arbitrary locations on the system by using paths with a ??\ prefix, which is equivalent to a \?\ prefix. These paths can bypass security restrictions and potentially lead to unauthorized access or other malicious activities.
Vulnerability Detail
The vulnerability arises from the filepath package's failure to recognize paths with a ??\ prefix as special on Windows systems. This prefix is used to denote Root Local Device paths, which can access arbitrary locations on the system. The Clean function in the package could convert a rooted path like \a..??\b into the root local device path ??\b. Similarly, the Join function could convert innocent path elements into the root local device path ??\b.
This insecure parsing of Windows paths can have severe consequences, including unauthorized access to sensitive files or directories, privilege escalation, and potential code execution. Attackers can exploit this vulnerability to bypass security measures and perform malicious actions on the affected system.
How To Fix
Latest published version: go1.25.5 as of 22 Oct 2026
go get stdlib@vgo1.25.5
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 1.20.111.20.11go get stdlib@v1.20.11 -
>= 1.20.11, < 1.20.121.20.12go get stdlib@v1.20.12 -
>= 1.21.0-0, < 1.21.41.21.4go get stdlib@v1.21.4 -
>= 1.21.4, < 1.21.51.21.5go get stdlib@v1.21.5
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If updating the Go standard library is not immediately feasible, a possible workaround is to manually sanitize and validate file paths before using them in the application. This can be done by checking for the presence of the ??\ prefix and rejecting or modifying the path accordingly.
Here is an example of a workaround function that checks for the ??\ prefix and replaces it with a safer alternative:
import "path/filepath"
func sanitizePath(path string) string {
if filepath.HasPrefix(path, "\\??\\") {
return ".\\??\\" + filepath.Clean(path[6:])
}
return path
}
Conclusion
The filepath package in versions before 1.20.11 and 1.21.4 of the Go standard library is vulnerable to an insecure parsing issue on Windows systems. This vulnerability allows attackers to access arbitrary locations on the system and can lead to unauthorized access, privilege escalation, and potential code execution. It is crucial for developers to update their Go installations and rebuild their applications with the patched version of the filepath package to mitigate this vulnerability.
For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
The vulnerability allows attackers to access arbitrary locations on the system by using specially crafted paths. This can lead to unauthorized access to sensitive files or directories, privilege escalation, and potential code execution.
Versions before 1.20.11 and 1.21.4 of the filepath package in the Go standard library are affected by this vulnerability.
Yes, all Windows systems using affected versions of the filepath package are vulnerable to this issue.
At the time of this report, there is no known public exploit for this vulnerability. However, it is important to apply the recommended fix as soon as possible to mitigate the risk.
No, this vulnerability requires local access to the affected system. However, it can be leveraged by an attacker who already has access to the system to escalate privileges or perform unauthorized actions.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.