CVE-2022-41720

Restricted file access on Windows in os and net/http

HIGH
7.5
CVSS Score
Published: December 7, 2022 at 04:11 PM UTC
Updated: June 17, 2026 at 05:03 AM UTC
3 products affected across 2 vendorsGo.NETOS· also runs on 1 platform

Using os by Go standard library?

Get instant alerts when new vulnerabilities affect os - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 1%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 1.18.91.19.0 ≤ v < 1.19.4
Affected range stops below 1.18.9, so it looks safe — our inference, not a vendor statement
Affected range stops below 1.19.4, so it looks safe — our inference, not a vendor statement
microsoft-windows (environment)
v < 1.18.91.19.0-0 ≤ v < 1.19.41.19.0-0
Affected range stops below 1.18.9, so it looks safe — our inference, not a vendor statement
Affected range stops below 1.19.4, so it looks safe — our inference, not a vendor statement
v < 1.18.91.19.0-0 ≤ v < 1.19.41.19.0-0
Affected range stops below 1.18.9, so it looks safe — our inference, not a vendor statement
Affected range stops below 1.19.4, so it looks safe — our inference, not a vendor statement

Runs on — not affected

The affected product only carries this flaw when running on these platforms. The platforms themselves are not vulnerable.

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.5HIGHCISA-ADP
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-22

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card