widget-samples icon indicating copy to clipboard operation
widget-samples copied to clipboard

Fixed Vitejs vulnerable to directory traversal via crafted URL to victim's service

Open zerodaypwn opened this issue 2 years ago • 0 comments

👾 Describe The Sumarry:

Vitejs before v2.9.13 was discovered to allow attackers to perform a directory traversal via a crafted URL to the victim's service. A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files. st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route. If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip. One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

🥷 According CVeScores:

CVE-2022-35204 CWE-22 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

zerodaypwn avatar Dec 05 '22 11:12 zerodaypwn