{"cve":"CVE-2022-41720","nvd":{"published":"2022-12-07T17:15:10.293","modified":"2026-06-17T05:03:42.497","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5},"cwes":["CWE-22"],"references":["https://go.dev/cl/455716","https://go.dev/issue/56694","https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ","https://pkg.go.dev/vuln/GO-2022-1143","https://go.dev/cl/455716"],"products":["golang:go"],"source":"nvd","synced_at":"2026-10-19T21:37:28.463369388+00:00"},"epss":{"cve":"CVE-2022-41720","score":0.01279,"percentile":0.70002,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GO-2022-1143","url":"https://osv.dev/vulnerability/GO-2022-1143","summary":"Restricted file access on Windows in os and net/http","modified":"2026-02-04T04:08:13.589543Z","packages":[{"ecosystem":"Go","name":"stdlib","purl":"pkg:golang/stdlib","ranges":["<1.18.9",">=1.19.0-0 <1.19.4"],"fixed":["1.18.9","1.19.4"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}