CVE-2022-41720 json
Restricted file access on Windows in os and net/http
published 3y ago modified 2mo ago also BIT-golang-2022-41720 , EUVD-2022-44894 , GO-2022-1143
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 70%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- bitnami golang 1.18.9, 1.19.4
- go stdlib 1.18.9, 1.19.4
- Go standard library os 1.18.9, 1.19.4
- Go standard library net/http 1.18.9, 1.19.4
- golang-1.19 Debian 12 1.19.4-1
debian advisories DEBIAN-CVE-2022-41720
- go1.18-openssl SLES for SAP 15 SP3, SLES 15 SP3-LTSS, SLE Real Time 15 SP3 +6 more 1.18.10.1-150000.1.9.1
- container-suseconnect SLES for SAP 15 SP3, SLES for SAP 15 SP2, SLES for SAP 15 SP1 +10 more 2.4.0-150000.4.24.1
- go1.18 SLE Module for Development Tools 15 SP4, SLE Module for Development Tools 15 SP3, openSUSE Leap 15.4 +1 more 1.18.9-150000.1.40.1
- go1.19 SLE Module for Development Tools 15 SP4, SLE Module for Development Tools 15 SP3, openSUSE Leap 15.4 +1 more 1.19.4-150000.1.18.1
suse advisories SUSE-SU-2023:2312-1SUSE-SU-2023:0871-1SUSE-SU-2022:4398-1SUSE-SU-2022:4397-1
- go1.18 openSUSE Tumbleweed 1.18.9-1.1
- go1.19 openSUSE Tumbleweed 1.19.4-1.1
opensuse advisories openSUSE-SU-2024:12552-1openSUSE-SU-2024:12553-1
- go.dev/cl/455716 advisory
- groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ advisory
- pkg.go.dev/vuln/GO-2022-1143 advisory
Is CVE-2022-41720 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-41720 updated cvss 7.5
golang: os, net/http: avoid escapes from os.DirFS and http.Dir on Windows
-
Red Hat Application Interconnect 1.0 skupper-cli skupper-cli Red Hat Service Telemetry Framework 1.5 stf/sg-core-rhel8affected: no fix available
-
Red Hat cert-manager Operator for Red Hat OpenShift cert-manager/cert-manager-operator-rhel9 Red Hat Cryostat 2 cryostat-tech-preview/cryostat-rhel8-operator Red Hat Custom Metric Autoscaler operator for Red Hat Openshift custom-metrics-autoscaler/custom-metrics-autoscaler-rhel8 Red Hat Logging Subsystem for Red Hat OpenShift openshift-logging/logging-loki-rhel9 Red Hat Migration Toolkit for Applications 6 mta/mta-hub-rhel8 Red Hat Migration Toolkit for Containers rhmtc/openshift-velero-plugin-rhel8not affected: vulnerable code not present
+32 more productsfewer
Red Hat Migration Toolkit for Virtualization migration-toolkit-virtualization/mtv-controller-rhel9 Red Hat Node HealthCheck Operator workload-availability/node-healthcheck-rhel8-operator Red Hat Node Maintenance Operator workload-availability/node-maintenance-rhel8-operator Red Hat OpenShift API for Data Protection oadp/oadp-velero-rhel8 Red Hat OpenShift Developer Tools and Services odo, helm, ocp-tools-4/jenkins-rhel8 Red Hat OpenShift Pipelines openshift-pipelines-client Red Hat OpenShift Secondary Scheduler Operator openshift-secondary-scheduler-operator/secondary-scheduler-operator-rhel8 Red Hat OpenShift Serverless openshift-serverless-clients, openshift-serverless-1/client-kn-rhel8 Red Hat OpenShift Service Mesh 2 openshift-golang-builder-container Red Hat 3scale API Management Platform 2 3scale-amp2/3scale-rhel7-operator Red Hat Advanced Cluster Management for Kubernetes 2 rhacm2/subctl-rhel9 Red Hat Advanced Cluster Security 3 advanced-cluster-security/rhacs-main-rhel8 Red Hat Ansible Automation Platform 2 receptor, openshift-clients Red Hat Ceph Storage 3 golang, golang-bin, golang-src Red Hat Ceph Storage 5 rhceph/rhceph-5-dashboard-rhel8 Red Hat Enterprise Linux 8 delve, conmon, golang, podman, skopeo, buildah, +40 more Red Hat Enterprise Linux 9 butane, conmon, golang, podman, skopeo, buildah, +30 more Red Hat OpenShift Container Platform 4 cri-o, butane, conmon, podman, skopeo, buildah, +43 more Red Hat Openshift Data Foundation 4 mcg, odf4/cephcsi-rhel9 Red Hat OpenShift Dev Spaces devspaces/udi-rhel8 Red Hat OpenShift distributed tracing 2 rhosdt/jaeger-agent-rhel8 Red Hat OpenShift GitOps openshift-gitops-kam, openshift-gitops-1/gitops-rhel8 Red Hat OpenShift on AWS rosa Red Hat Openshift Sandboxed Containers openshift-sandboxed-containers/osc-rhel8-operator Red Hat OpenShift Virtualization 4 kubevirt, container-native-virtualization/virt-api Red Hat OpenStack Platform 16.2 etcd, collectd-libpod-stats, rhosp-rhel8/osp-director-agent, golang-github-infrawatch-apputils Red Hat OpenStack Platform 17.0 collectd-libpod-stats, golang-github-infrawatch-apputils Red Hat Quay 3 quay/clair-rhel8 Red Hat Satellite 6 yggdrasil, foreman_ygg_worker, yggdrasil-worker-forwarder Red Hat Storage 3 golang, heketi, golang-bin, golang-src, golang-misc, golang-tests, +3 more Red Hat Web Terminal web-terminal-exec-container Red Hat Self Node Remediation Operator workload-availability/self-node-remediation-rhel8-operator
2 more not affected in the full advisory
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- last yr.
Exploit prediction
1.28% chance of exploitation in the next 30 days, higher than 70% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | golang | <1.18.9 >=1.19.0, <1.19.4 |
1.18.9 1.19.4 |
| go | stdlib | <1.18.9 >=1.19.0-0, <1.19.4 |
1.18.9 1.19.4 |
Affected products
- Go standard library os
- Go standard library net/http
Classification
- Weakness
-
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
References
-
go.dev
/cl/455716
patch, vendor-advisory, advisory
-
groups.google.com
/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ
patch, release-notes, third-party-advisory, advisory, web
-
pkg.go.dev
/vuln/GO-2022-1143
patch, vendor-advisory, advisory
-
go.dev
/issue/56694
issue-tracking, vendor-advisory, advisory, report
-
nvd.nist.gov
/vuln/detail/CVE-2022-41720
web
Sources
- CVE List CVE-2022-41720
- NVD CVE-2022-41720
- OSV BIT-golang-2022-41720
- OSV GO-2022-1143
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.