# CVE-2022-41720: golang-1.19: On Windows, restricted files can be accessed via os.DirFS and http.Dir

CVE-2022-41720 is fixed in 10 products on 1 platform, first by DEBIAN-CVE-2022-41720, released December 7, 2022. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2022-41720
- Priority: High
- CVSS: 7.5 (high)
- EPSS: 0.0128
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Dec 7, 2022

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

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | delve ol 8 | 0:1.9.1-1.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | go-toolset ol 8 | 0:1.19.4-1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-1.19 Debian 12.15 (bookworm) | 1.19.4-1 | [DEBIAN-CVE-2022-41720](https://patchblox.com/security/data/fix/linux/debian-cve-2022-41720.md) | Dec 7, 2022 |
| Linux | golang-bin ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-docs ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-misc ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-race ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-src ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |
| Linux | golang-tests ol 8 | 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba | [ELSA-2023-18908](https://patchblox.com/security/data/fix/linux/elsa-2023-18908.md) | Mar 7, 2023 |

---

Data as of 2026-11-08T06:59:42Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
