Уязвимость доступа к ограниченным файлам через функции "os.DirFS" и тип "http.Dir" на Windows
Описание
На Windows злоумышленник способен получить доступ к ограниченным файлам с помощью функции os.DirFS
и типа http.Dir
. Эти методы обеспечивают доступ к дереву файлов, начиная с указанного каталога. Злоумышленник получает возможность чтения файлов устройств Windows в этой корневой директории. Например, os.DirFS("C:/tmp").Open("COM1")
открывает устройство COM1. Оба метода предоставляют доступ к файловой системе только для чтения. Более того, в Windows использование os.DirFS
для корневой директории текущего диска позволяет использовать специально созданный путь, чтобы выйти за пределы этого диска и получить доступ к любому пути в системе.
Тип уязвимости
Доступ к ограниченным файлам
Ссылки
- PatchVendor Advisory
- Issue TrackingVendor Advisory
- PatchRelease NotesThird Party Advisory
- PatchVendor Advisory
- PatchVendor Advisory
- Issue TrackingVendor Advisory
- PatchRelease NotesThird Party Advisory
- PatchVendor Advisory
Уязвимые конфигурации
Одновременно
Одно из
EPSS
7.5 High
CVSS3
Дефекты
Связанные уязвимости
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.
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.
On Windows, restricted files can be accessed via os.DirFS and http.Dir ...
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.
EPSS
7.5 High
CVSS3