CVE-2022-41720
golang: os, net/http: avoid escapes from os.DirFS and http.Dir on Windows
Overview
Description
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.
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness: CWE-22
Affected packages · 2
Operating systems · 23 fixes
Oracle Linux 1 release · 3 packages
| Release | Package | Fixed in |
|---|---|---|
| 8 | go-toolset | 1.19.4-1.module+el8.7.0+20922+47ac84ba |
| 8 | golang +6 | 1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba |
| 8 | delve | 1.9.1-1.0.1.module+el8.7.0+20922+47ac84ba |
Photon OS 2 releases · 3 packages
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | kubernetes-dashboard | 2.7.0-1.ph4 |
| 5.0 | falco | 0.32.2-6.0601037001.ph5 |
| 5.0 | go | 1.26.3-1.ph5 |
| 5.0 | kubernetes-dashboard | 2.7.0-6.ph5 |
SUSE Linux Enterprise 1 release · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | go1-18-openssl +2 | 1.18.10.1-150000.1.9.1 | SUSE-SU-2023:2312-1 |
| 15.4 | go1-18 +2 | 1.18.9-150000.1.40.1 | SUSE-SU-2022:4398-1 |
| 15.4 | go1-19 +2 | 1.19.4-150000.1.18.1 | SUSE-SU-2022:4397-1 |
| 15.4 | container-suseconnect | 2.4.0-150000.4.24.1 | SUSE-SU-2023:0871-1 |
chainguard 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| kubeflow-katib | 0.19.0-r40 |
debian 2 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | golang-1-15 | affected |
| 12 | golang-1-19 | 1.19.4-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| golang-1-19 | 1.19.4-1 |
openSUSE 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | go1-18 +2 | 1.18.9-1.1 | openSUSE-SU-2024:12552-1 |
| Tumbleweed | go1-19 +2 | 1.19.4-1.1 | openSUSE-SU-2024:12553-1 |
root.io debian 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | rootio-golang-1-19 | 1.19.4-1 |
wolfi 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| kubeflow-katib | 0.19.0-r40 |
alpine 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.22 | go | not affected |
| 3.23 | go | not affected |
| 3.24 | go | not affected |
| edge | go | not affected |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-41720
- go.dev https://go.dev/cl/455716
- go.dev https://go.dev/issue/56694
- groups.google.com https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ
- linux.oracle.com https://linux.oracle.com/cve/CVE-2022-41720.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2023-18908.html
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-41720
- pkg.go.dev https://pkg.go.dev/vuln/GO-2022-1143
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-41720
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.