CVE-2022-41720

NameCVE-2022-41720
DescriptionOn 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
golang-1.11 (PTS)buster1.11.6-1+deb10u4vulnerable (unimportant)
buster (security)1.11.6-1+deb10u7vulnerable (unimportant)
golang-1.15 (PTS)bullseye1.15.15-1~deb11u4vulnerable (unimportant)
golang-1.19 (PTS)bookworm1.19.8-2fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
golang-1.11source(unstable)(unfixed)unimportant
golang-1.15source(unstable)(unfixed)unimportant
golang-1.18source(unstable)1.18.9-1unimportant
golang-1.19source(unstable)1.19.4-1unimportant

Notes

https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU
https://go.dev/issue/56694
Only affects code cross compiled on Debian for Windows binaries

Search for package or bug name: Reporting problems