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.

High
CVSS
7.5
high
Exploitation
None reported
No vendor assessment
CISA KEV
Not listed
Not in the Known Exploited Vulnerabilities catalog
EPSS
0.0128
70th percentile

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

ProductFixed inFixReleased
Linux
delve · ol 8 0:1.9.1-1.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
go-toolset · ol 8 0:1.19.4-1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-1.19 · Debian 12.15 (bookworm) 1.19.4-1 DEBIAN-CVE-2022-41720 Dec 7, 2022
golang-bin · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-docs · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-misc · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-race · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-src · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023
golang-tests · ol 8 0:1.19.4-2.0.1.module+el8.7.0+20922+47ac84ba ELSA-2023-18908 Mar 7, 2023

Patch Radar data is free to use with attribution. Terms and how to credit it.

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.