Every CVE Search/ Get API key

CVE-2022-41720

Restricted file access on Windows in os and net/http

7.5 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
None
Availability
None

Exploit likelihood

1.28%Up 0.3 points since Dec 8, 2022
90%50%10%1%

What each source reports

NVD Score used 7.5

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.

Record
CVE-2022-41720
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
CVE List 7.5

Restricted file access on Windows in os and net/http

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.

Record
CVE-2022-41720
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
EUVDEUVD-2022-44894 7.5

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.

Record
EUVD-2022-44894
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-cvf9-g74c-vv79 7.5

On Windows, restricted files can be accessed via os.DirFS and http.Dir. The os.DirFS function and...

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.

Record
GHSA-cvf9-g74c-vv79
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
OSVAZL-79038 7.5

CVE-2022-41720 affecting package golang 1.25.7-1

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.

Record
AZL-79038
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSVAZL-98604 7.5

CVE-2022-41720 affecting package golang 1.27.1-1

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.

Record
AZL-98604
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
Show 11 moreShow less
OSVBELL-CVE-2022-41720 7.5

CVE-2022-41720 does not affect BellSoft software

Record
BELL-CVE-2022-41720
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSV 7.5

Restricted file access on Windows in os and net/http

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.

Record
CVE-2022-41720
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSVBIT-golang-2022-41720 No score

Restricted file access on Windows in os and net/http

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.

Record
BIT-golang-2022-41720
Updated
2026-11-02
OSVDEBIAN-CVE-2022-41720 No score

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.

Record
DEBIAN-CVE-2022-41720
Updated
2026-11-03
OSVGO-2022-1143 No score

Restricted file access on Windows in os and net/http

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.

Record
GO-2022-1143
Updated
2026-11-02
OSVopenSUSE-SU-2024:12552-1 No score

go1.18-1.18.9-1.1 on GA media

These are all security issues fixed in the go1.18-1.18.9-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12552-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:12553-1 No score

go1.19-1.19.4-1.1 on GA media

These are all security issues fixed in the go1.19-1.19.4-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12553-1
Updated
2026-11-02
OSVSUSE-SU-2022:4397-1 No score

Security update for go1.19

This update for go1.19 fixes the following issues:

Update to version 1.19.4, includes the following security fixes:

  • CVE-2022-41717: net/http: limit canonical header cache by bytes, not entries (bsc#1206135).
  • CVE-2022-41720: os, net/http: avoid escapes from os.DirFS and http.Dir on Windows (bsc#1206134).
Record
SUSE-SU-2022:4397-1
Updated
2026-11-02
OSVSUSE-SU-2022:4398-1 No score

Security update for go1.18

This update for go1.18 fixes the following issues:

Update to version 1.18.9, includes the following security fixes:

  • CVE-2022-41717: net/http: limit canonical header cache by bytes, not entries (bsc#1206135)
  • CVE-2022-41720: os, net/http: avoid escapes from os.DirFS and http.Dir on Windows (bsc#1206134)
Record
SUSE-SU-2022:4398-1
Updated
2026-11-02
OSVSUSE-SU-2023:0871-1 No score

Security update for container-suseconnect

This update of container-suseconnect fixes the following issue:

  • container-suseconnect was rebuilt against the current go1.19 release, fixing security issues and other bugs fixed in go1.19.7.

  • CVE-2022-41723: Fixed quadratic complexity in HPACK decoding (bsc#1208270).

  • CVE-2022-41724: Fixed panic with arge handshake records in crypto/tls (bsc#1208271).

  • CVE-2022-41725: Fixed denial of service from excessive resource consumption in net/http and mime/multipart (bsc#1208272).

  • CVE-2023-24532: Fixed incorrect P-256 ScalarMult and ScalarBaseMult results (bsc#1209030).

  • CVE-2022-41720: os, net/http: avoid escapes from os.DirFS and http.Dir on Windows (bsc#1206134).

Record
SUSE-SU-2023:0871-1
Updated
2026-11-02
OSVSUSE-SU-2023:2312-1 No score

Security update for go1.18-openssl

This update for go1.18-openssl fixes the following issues:

  • Add subpackage go1.x-libstd compiled shared object libstd.so (jsc#PED-1962)

    • Main go1.x package included libstd.so in previous versions
    • Split libstd.so into subpackage that can be installed standalone
    • Continues the slimming down of main go1.x package by 40 Mb
    • Experimental and not recommended for general use, Go currently has no ABI
    • Upstream Go has not committed to support buildmode=shared long-term
    • Do not use in packaging, build static single binaries (the default)
    • Upstream Go go1.x binary releases do not include libstd.so
    • go1.x Suggests go1.x-libstd so not installed by default Recommends
    • go1.x-libstd does not Require: go1.x so can install standalone
    • Provides go-libstd unversioned package name
    • Fix build step -buildmode=shared std to omit -linkshared
  • Packaging improvements:

    • go1.x Suggests go1.x-doc so not installed by default Recommends
    • Use Group: Development/Languages/Go instead of Other
  • Improvements to go1.x packaging spec:

    • On Tumbleweed bootstrap with current default gcc13 and gccgo118
    • On SLE-12 aarch64 ppc64le ppc64 remove overrides to bootstrap using go1.x package (%bcond_without gccgo). This is no longer needed on current SLE-12:Update and removing will consolidate the build configurations used.
    • Change source URLs to go.dev as per Go upstream
    • On x86_64 export GOAMD64=v1 as per the current baseline. At this time forgo GOAMD64=v3 option for x86_64_v3 support.
    • On x86_64 %define go_amd64=v1 as current instruction baseline
  • Update to version 1.18.10.1 cut from the go1.18-openssl-fips branch at the revision tagged go1.18.10-1-openssl-fips.

    • Merge branch dev.boringcrypto.go1.18 into go1.18-openssl-fips
    • Merge go1.18.10 into dev.boringcrypto.go1.18
  • go1.18.10 (released 2023-01-10) includes fixes to cgo, the compiler, the linker, and the crypto/x509, net/http, and syscall packages. Refs bsc#1193742 go1.18 release tracking

    • go#57705 misc/cgo: backport needed for dlltool fix
    • go#57426 crypto/x509: Verify on macOS does not return typed errors
    • go#57344 cmd/compile: the loong64 intrinsic for CompareAndSwapUint32 function needs to sign extend its 'old' argument.
    • go#57338 syscall, internal/poll: accept4-to-accept fallback removal broke Go code on Synology DSM 6.2 ARM devices
    • go#57213 os: TestLstat failure on Linux Aarch64
    • go#57211 reflect: sort.SliceStable sorts incorrectly on arm64 with less function created with reflect.MakeFunc and slice of sufficient length
    • go#57057 cmd/go: remove test dependency on gopkg.in service
    • go#57054 cmd/go: TestScript/version_buildvcs_git_gpg (if enabled) fails on linux longtest builders
    • go#57044 cgo: malformed DWARF TagVariable entry
    • go#57028 cmd/cgo: Wrong types in compiler errors with clang 14
    • go#56833 cmd/link/internal/ppc64: too-far trampoline is reused
    • go#56711 net: reenable TestLookupDotsWithRemoteSource and TestLookupGoogleSRV with a different target
    • go#56323 net/http: bad handling of HEAD requests with a body
Record
SUSE-SU-2023:2312-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
golang
Azure Linux:3
through 1.25.7-1 None known
golang
Azure Linux:3
1.27.0 to 1.27.1-1 None known
golang
Bitnami
before 1.18.9, 1.19.0 up to 1.19.4
1.18.91.19.4
golang-1.19
Debian:12
before 1.19.4-1
1.19.4-1
stdlib
Go
before 1.18.9, 1.19.0-0 up to 1.19.4
1.18.91.19.4
go1.19
SUSE:Linux Enterprise Module for Development Tools 15 SP3
From an advisory covering 2 CVEs
before 1.19.4-150000.1.18.1
1.19.4-150000.1.18.1
go1.19
SUSE:Linux Enterprise Module for Development Tools 15 SP4
From an advisory covering 2 CVEs
before 1.19.4-150000.1.18.1
1.19.4-150000.1.18.1
go1.19
openSUSE:Leap 15.3
From an advisory covering 2 CVEs
before 1.19.4-150000.1.18.1
1.19.4-150000.1.18.1
go1.19
openSUSE:Leap 15.4
From an advisory covering 2 CVEs
before 1.19.4-150000.1.18.1
1.19.4-150000.1.18.1
go1.18
SUSE:Linux Enterprise Module for Development Tools 15 SP3
From an advisory covering 2 CVEs
before 1.18.9-150000.1.40.1
1.18.9-150000.1.40.1
Show 27 moreShow less
Affected packages
PackageAffectedFixed
go1.18
SUSE:Linux Enterprise Module for Development Tools 15 SP4
From an advisory covering 2 CVEs
before 1.18.9-150000.1.40.1
1.18.9-150000.1.40.1
go1.18
openSUSE:Leap 15.3
From an advisory covering 2 CVEs
before 1.18.9-150000.1.40.1
1.18.9-150000.1.40.1
go1.18
openSUSE:Leap 15.4
From an advisory covering 2 CVEs
before 1.18.9-150000.1.40.1
1.18.9-150000.1.40.1
container-suseconnect
SUSE:Linux Enterprise Module for Containers 15 SP4
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server 15 SP1-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server 15 SP2-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server 15 SP3-LTSS
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server for SAP Applications 15 SP1
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server for SAP Applications 15 SP2
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Linux Enterprise Server for SAP Applications 15 SP3
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Enterprise Storage 7
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
container-suseconnect
SUSE:Enterprise Storage 7.1
From an advisory covering 5 CVEs
before 2.4.0-150000.4.24.1
2.4.0-150000.4.24.1
go1.18-openssl
SUSE:Linux Enterprise Module for Development Tools 15 SP4
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Linux Enterprise Real Time 15 SP3
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Linux Enterprise Server 15 SP3-LTSS
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Linux Enterprise Server for SAP Applications 15 SP3
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
SUSE:Enterprise Storage 7.1
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
openSUSE:Leap 15.4
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18-openssl
openSUSE:Leap 15.5
From an advisory covering 28 CVEs
before 1.18.10.1-150000.1.9.1
1.18.10.1-150000.1.9.1
go1.18
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 1.18.9-1.1
1.18.9-1.1
go1.19
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 1.19.4-1.1
1.19.4-1.1

History

History
RecordedChangedSources
affected, factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-41720 is a high vulnerability (CVSS 7.5) in Go Standard Library Net/http, published December 7, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.28%, the 70th percentile. Fixed in golang 1.18.9.

References

Show 70 moreShow less
MoveEnter Open