CVEfocus › CVE database › CVE-2022-41720

CVE-2022-41720Restricted file access on Windows in os and net/http

CVSS 7.5 HighEPSS 1.3% (higher than 70% of CVEs)Published 2022-12-07Updated 2025-04-23Assigner: Go

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.

What to do

Fixed builds are available from Debian, Go: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

2Fixed
7Fix pending
92Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04golang-1.17Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.18Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.13Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.14Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.18Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.10Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.8Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.9Not affected
vulnerable_code_not_present
Ubuntu 16.04golangFix pending
Ubuntu 16.04golang-1.10Fix pending
Ubuntu 16.04golang-1.13Fix pending
Ubuntu 16.04golang-1.6Fix pending
Ubuntu 14.04golangFix pending
Ubuntu 14.04golang-1.10Fix pending
Ubuntu 14.04golang-1.6Fix pending
Debian 12golang-1.19Fixed1.19.4-1DEBIAN-CVE-2022-41720
Red Hat Enterprise Linux 9buildahNot affected
Red Hat Enterprise Linux 9buildah-testsNot affected
Red Hat Enterprise Linux 9butaneNot affected
Red Hat Enterprise Linux 9conmonNot affected
Red Hat Enterprise Linux 9containernetworking-pluginsNot affected
Red Hat Enterprise Linux 9git-lfsNot affected
Red Hat Enterprise Linux 9go-toolsetNot affected
Red Hat Enterprise Linux 9golangNot affected
Red Hat Enterprise Linux 9golang-binNot affected
Red Hat Enterprise Linux 9golang-docsNot affected
Red Hat Enterprise Linux 9golang-miscNot affected
Red Hat Enterprise Linux 9golang-raceNot affected
Red Hat Enterprise Linux 9golang-srcNot affected
Red Hat Enterprise Linux 9golang-testsNot affected
Red Hat Enterprise Linux 9grafanaNot affected
Red Hat Enterprise Linux 9grafana-pcpNot affected
Red Hat Enterprise Linux 9grafana-selinuxNot affected
Red Hat Enterprise Linux 9ignitionNot affected
Red Hat Enterprise Linux 9ignition-edgeNot affected
Red Hat Enterprise Linux 9ignition-grubNot affected
Red Hat Enterprise Linux 9ignition-validateNot affected
Red Hat Enterprise Linux 9osbuild-composerNot affected
Red Hat Enterprise Linux 9osbuild-composer-coreNot affected
Red Hat Enterprise Linux 9osbuild-composer-dnf-jsonNot affected
Red Hat Enterprise Linux 9osbuild-composer-workerNot affected
Red Hat Enterprise Linux 9podmanNot affected
Red Hat Enterprise Linux 9podman-catatonitNot affected
Red Hat Enterprise Linux 9podman-dockerNot affected
Red Hat Enterprise Linux 9podman-gvproxyNot affected
Red Hat Enterprise Linux 9podman-pluginsNot affected
Red Hat Enterprise Linux 9podman-remoteNot affected
Red Hat Enterprise Linux 9podman-testsNot affected
Red Hat Enterprise Linux 9skopeoNot affected
Red Hat Enterprise Linux 9skopeo-testsNot affected
Red Hat Enterprise Linux 9toolboxNot affected
Red Hat Enterprise Linux 9toolbox-testsNot affected
Red Hat Enterprise Linux 9weldr-clientNot affected
Red Hat Enterprise Linux 8buildahNot affected
Red Hat Enterprise Linux 8buildah-testsNot affected
Red Hat Enterprise Linux 8conmonNot affected
Red Hat Enterprise Linux 8containernetworking-pluginsNot affected
Red Hat Enterprise Linux 8containers-commonNot affected
Red Hat Enterprise Linux 8delveNot affected
Red Hat Enterprise Linux 8git-lfsNot affected
Red Hat Enterprise Linux 8go-toolsetNot affected
Red Hat Enterprise Linux 8golangNot affected
Red Hat Enterprise Linux 8golang-binNot affected
Red Hat Enterprise Linux 8golang-docsNot affected
Red Hat Enterprise Linux 8golang-miscNot affected
Red Hat Enterprise Linux 8golang-raceNot affected
Red Hat Enterprise Linux 8golang-srcNot affected
Red Hat Enterprise Linux 8golang-testsNot affected
Red Hat Enterprise Linux 8grafanaNot affected
Red Hat Enterprise Linux 8grafana-azure-monitorNot affected
Red Hat Enterprise Linux 8grafana-cloudwatchNot affected
Red Hat Enterprise Linux 8grafana-elasticsearchNot affected
Red Hat Enterprise Linux 8grafana-graphiteNot affected
Red Hat Enterprise Linux 8grafana-influxdbNot affected
Red Hat Enterprise Linux 8grafana-lokiNot affected
Red Hat Enterprise Linux 8grafana-mssqlNot affected
Red Hat Enterprise Linux 8grafana-mysqlNot affected
Red Hat Enterprise Linux 8grafana-opentsdbNot affected
Red Hat Enterprise Linux 8grafana-pcpNot affected
Red Hat Enterprise Linux 8grafana-postgresNot affected
Red Hat Enterprise Linux 8grafana-prometheusNot affected
Red Hat Enterprise Linux 8grafana-selinuxNot affected
Red Hat Enterprise Linux 8grafana-stackdriverNot affected
Red Hat Enterprise Linux 8osbuild-composerNot affected
Red Hat Enterprise Linux 8osbuild-composer-coreNot affected
Red Hat Enterprise Linux 8osbuild-composer-dnf-jsonNot affected
Red Hat Enterprise Linux 8osbuild-composer-workerNot affected
Red Hat Enterprise Linux 8podmanNot affected
Red Hat Enterprise Linux 8podman-catatonitNot affected
Red Hat Enterprise Linux 8podman-dockerNot affected
Red Hat Enterprise Linux 8podman-gvproxyNot affected
Red Hat Enterprise Linux 8podman-manpagesNot affected
Red Hat Enterprise Linux 8podman-pluginsNot affected
Red Hat Enterprise Linux 8podman-remoteNot affected
Red Hat Enterprise Linux 8podman-testsNot affected
Red Hat Enterprise Linux 8skopeoNot affected
Red Hat Enterprise Linux 8skopeo-testsNot affected
Red Hat Enterprise Linux 8toolboxNot affected
Red Hat Enterprise Linux 8toolbox-testsNot affected
Red Hat Enterprise Linux 8weldr-clientNot affected
Go librarystdlibFixed1.19.4GO-2022-1143

What the vendor says

As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.