CVE-2022-41720Restricted file access on Windows in os and net/http
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | golang-1.17 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | golang-1.18 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | golang-1.13 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | golang-1.14 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | golang-1.18 | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | golang-1.10 | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | golang-1.8 | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | golang-1.9 | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | golang | Fix pending | ||
| Ubuntu 16.04 | golang-1.10 | Fix pending | ||
| Ubuntu 16.04 | golang-1.13 | Fix pending | ||
| Ubuntu 16.04 | golang-1.6 | Fix pending | ||
| Ubuntu 14.04 | golang | Fix pending | ||
| Ubuntu 14.04 | golang-1.10 | Fix pending | ||
| Ubuntu 14.04 | golang-1.6 | Fix pending | ||
| Debian 12 | golang-1.19 | Fixed | 1.19.4-1 | DEBIAN-CVE-2022-41720 |
| Red Hat Enterprise Linux 9 | buildah | Not affected | ||
| Red Hat Enterprise Linux 9 | buildah-tests | Not affected | ||
| Red Hat Enterprise Linux 9 | butane | Not affected | ||
| Red Hat Enterprise Linux 9 | conmon | Not affected | ||
| Red Hat Enterprise Linux 9 | containernetworking-plugins | Not affected | ||
| Red Hat Enterprise Linux 9 | git-lfs | Not affected | ||
| Red Hat Enterprise Linux 9 | go-toolset | Not affected | ||
| Red Hat Enterprise Linux 9 | golang | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-bin | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-docs | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-misc | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-race | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-src | Not affected | ||
| Red Hat Enterprise Linux 9 | golang-tests | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-pcp | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 9 | ignition | Not affected | ||
| Red Hat Enterprise Linux 9 | ignition-edge | Not affected | ||
| Red Hat Enterprise Linux 9 | ignition-grub | Not affected | ||
| Red Hat Enterprise Linux 9 | ignition-validate | Not affected | ||
| Red Hat Enterprise Linux 9 | osbuild-composer | Not affected | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-core | Not affected | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-dnf-json | Not affected | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-worker | Not affected | ||
| Red Hat Enterprise Linux 9 | podman | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-catatonit | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-docker | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-gvproxy | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-plugins | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-remote | Not affected | ||
| Red Hat Enterprise Linux 9 | podman-tests | Not affected | ||
| Red Hat Enterprise Linux 9 | skopeo | Not affected | ||
| Red Hat Enterprise Linux 9 | skopeo-tests | Not affected | ||
| Red Hat Enterprise Linux 9 | toolbox | Not affected | ||
| Red Hat Enterprise Linux 9 | toolbox-tests | Not affected | ||
| Red Hat Enterprise Linux 9 | weldr-client | Not affected | ||
| Red Hat Enterprise Linux 8 | buildah | Not affected | ||
| Red Hat Enterprise Linux 8 | buildah-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | conmon | Not affected | ||
| Red Hat Enterprise Linux 8 | containernetworking-plugins | Not affected | ||
| Red Hat Enterprise Linux 8 | containers-common | Not affected | ||
| Red Hat Enterprise Linux 8 | delve | Not affected | ||
| Red Hat Enterprise Linux 8 | git-lfs | Not affected | ||
| Red Hat Enterprise Linux 8 | go-toolset | Not affected | ||
| Red Hat Enterprise Linux 8 | golang | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-bin | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-docs | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-misc | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-race | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-src | Not affected | ||
| Red Hat Enterprise Linux 8 | golang-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-azure-monitor | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-cloudwatch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-elasticsearch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-graphite | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-influxdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-loki | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mssql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mysql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-opentsdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-pcp | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-postgres | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-prometheus | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-stackdriver | Not affected | ||
| Red Hat Enterprise Linux 8 | osbuild-composer | Not affected | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-core | Not affected | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-dnf-json | Not affected | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-worker | Not affected | ||
| Red Hat Enterprise Linux 8 | podman | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-catatonit | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-docker | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-gvproxy | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-manpages | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-plugins | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-remote | Not affected | ||
| Red Hat Enterprise Linux 8 | podman-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | skopeo | Not affected | ||
| Red Hat Enterprise Linux 8 | skopeo-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | toolbox | Not affected | ||
| Red Hat Enterprise Linux 8 | toolbox-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | weldr-client | Not affected | ||
| Go library | stdlib | Fixed | 1.19.4 | GO-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.
- Go standard library os: affected: before 1.18.9, 1.19.0-0 to before 1.19.4; fixed in
1.18.9,1.19.4 - Go standard library net/http: affected: before 1.18.9, 1.19.0-0 to before 1.19.4; fixed in
1.18.9,1.19.4
References
- https://go.dev/issue/56694
- https://go.dev/cl/455716
- https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ
- https://pkg.go.dev/vuln/GO-2022-1143
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.