{"id":"CVE-2022-41720","published":"2022-12-07T16:11:18Z","modified":"2025-04-23T15:43:46Z","title":"Restricted file access on Windows in os and net/http","vendor":"Go standard library","product":"os","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.01305,"percentile":0.71236,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/56694","tags":[]},{"url":"https://go.dev/cl/455716","tags":[]},{"url":"https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2022-1143","tags":[]}],"priority":{"score":19.5,"factors":[{"name":"EPSS percentile","points":14.25},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"go-standard-library","affectedVersions":[{"vendor":"Go standard library","product":"os","versions":["< 1.18.9",">= 1.19.0-0, < 1.19.4"]},{"vendor":"Go standard library","product":"net/http","versions":["< 1.18.9",">= 1.19.0-0, < 1.19.4"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:41:16.852650Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"stdlib","vulnerableRanges":["<1.18.9",">=1.19.0-0, <1.19.4"],"patched":["1.18.9","1.19.4"],"from":["GO-2022-1143"],"provenance":"source"}],"summary":{"text":"The flaw lies in the os.DirFS function and http.Dir type of the Go standard library's os package on Windows, which can expose Windows device files and, when rooted at a drive's root directory, let a crafted path escape to any location on the system. An attacker who can supply file paths to these functions over the network, with no authentication or user interaction required, can read files on the system, including Windows device files such as COM1 and paths outside the intended root, though these operations are read-only.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:16:57Z"},"euvd":{"id":"EUVD-2022-44894","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-41715","published":"2022-10-14","fixed":"1.19.2","kev":false},{"cve":"CVE-2022-41716","published":"2022-11-02","fixed":"1.19.3","kev":false,"link":{"from":"CVE-2022-41716","to":"CVE-2022-41720","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:stdlib","fromFixed":"1.18.8","toFixed":"1.18.9","daysApart":35}]}},{"cve":"CVE-2022-41717","published":"2022-12-08","fixed":"1.19.4","kev":false},{"cve":"CVE-2022-41720","published":"2022-12-07","fixed":"1.19.4","kev":false},{"cve":"CVE-2023-45287","published":"2023-12-05","fixed":"1.20.0","kev":false},{"cve":"CVE-2022-41722","published":"2023-02-28","fixed":"1.20.1","kev":false},{"cve":"CVE-2022-41723","published":"2023-02-28","fixed":"1.20.1","kev":false}],"package":"Go:stdlib"}}