CVE-2022-41720
Restricted file access on Windows in os and net/http
Reported by go · Published December 7, 2022
stdlib is fixed in 1.19.4 and 1.18.9 (Go Modules)
On Windows, restricted files can be accessed via os.DirFS and http.Dir. The os.DirFS function and http.Dir type provide access to a tree of files rooted at a given directory. These functions permit access to Windows device files under that root. For example, os.DirFS("C:/tmp").Open("COM1") opens the COM1 device. Both os.DirFS and http.Dir only provide read-only filesystem access. In addition, on Windows, an os.DirFS for the directory (the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system. With fix applied, the behavior of os.DirFS("") has changed. Previously, an empty root was treated equivalently to "/", so os.DirFS("").Open("tmp") would open the path "/tmp". This now returns an error.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| stdlib | Go Modules | 1.19.4, 1.18.9 |
| net/http | Go Modules | 1.19.4, 1.18.9 |
| os | Go Modules | 1.19.4, 1.18.9 |
| golang | Bitnami | 1.19.4, 1.18.9 |
| kubeflow-katib | Wolfi | 0.19.0-r40, 0.19.0-r31 |
| kubeflow-katib | Chainguard | 0.19.0-r40, 0.19.0-r31 |
| go | golang | 1.19.4, 1.18.9 |
| golang | Bitnami | 1.19.4, 1.18.9 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Go standard library | os | 0, 1.19.0-0 |
| Go standard library | net/http | 0, 1.19.0-0 |
| wolfi | go-1.19 | * |
| Go | stdlib | |
| wolfi | kubeflow-katib | 0, 0 |
| chainguard | go-1.19 | * |
| Go standard library | net/http | 1.19.0-0, 0 |
| alpine | go | * |
| Go standard library | os | 0, 1.19.0-0 |
| chainguard | kubeflow-katib | 0, 0 |
Timeline
- Dec 7, 2022 CVE Published
- Dec 8, 2022 EPSS Score (30 in total, the first dated here)
- Mar 21, 2026 Security Advisory (4 in total, the first dated here)
- Jun 15, 2026 Coalition ESS Score
- Jul 2, 2026 Distribution Patch
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-41720
vulnetix vdb fixes CVE-2022-41720
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-41720/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart