VDB

CVE-2022-41720

CVE-2022-41720 PUBLISHED CVSS 7.5 HIGH

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.

PackageEcosystemFixed in
stdlibGo Modules1.19.4, 1.18.9
net/httpGo Modules1.19.4, 1.18.9
osGo Modules1.19.4, 1.18.9
golangBitnami1.19.4, 1.18.9
kubeflow-katibWolfi0.19.0-r40, 0.19.0-r31
kubeflow-katibChainguard0.19.0-r40, 0.19.0-r31
gogolang1.19.4, 1.18.9
golangBitnami1.19.4, 1.18.9

Risk scores

CVSS 3.1
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected products

VendorProductVersions
Go standard libraryos0, 1.19.0-0
Go standard librarynet/http0, 1.19.0-0
wolfigo-1.19*
Gostdlib
wolfikubeflow-katib0, 0
chainguardgo-1.19*
Go standard librarynet/http1.19.0-0, 0
alpinego*
Go standard libraryos0, 1.19.0-0
chainguardkubeflow-katib0, 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

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›