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

- Severity: High 7.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.31%, higher than 71% of CVEs (2026-12-01)
- Published: 2022-12-07T16:08:45.000Z
- Modified: 2026-09-08T08:47:49.065Z
- Also known as: GO-2022-1143, BIT-GOLANG-2022-41720
- Related: CGA-4cph-r9f7-h2c8
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: Go

## 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.

(As written by CVE List.)

## Affected

- os: before 1.18.9; from 1.19.0-0 before 1.19.4
- net/http: before 1.18.9; from 1.19.0-0 before 1.19.4
- stdlib (Go): before 1.18.9; from 1.19.0-0 before 1.19.4
- golang go: before 1.18.9; from 1.19.0 before 1.19.4
- golang (Bitnami): before 1.18.9; from 1.19.0 before 1.19.4

## Every score

- CISA-ADP: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://go.dev/issue/56694> (advisory, issue-tracking, report, vendor-advisory)
- <https://go.dev/cl/455716> (advisory, fix, patch, vendor-advisory)
- <https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ> (advisory, patch, release-notes, third-party-advisory, web)
- <https://pkg.go.dev/vuln/GO-2022-1143> (advisory, patch, vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-41720> (web)

## Sources

- CVE List: [CVE-2022-41720](https://www.cve.org/CVERecord?id=CVE-2022-41720), CVE Terms of Use, modified 2025-04-23
- Go Vulnerability Database: [GO-2022-1143](https://pkg.go.dev/vuln/GO-2022-1143), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2022-41720](https://nvd.nist.gov/vuln/detail/CVE-2022-41720), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2022-41720](https://osv.dev/vulnerability/BIT-GOLANG-2022-41720), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-41720 · Whole record: https://cve.day/CVE-2022-41720.json · Rebuilt by cve.day 2026-11-25T22:58:17.291Z
