Vulnerabilities |
5 via 5 paths |
|---|---|
Dependencies |
204 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
critical severity
new
- Vulnerable module: esbuild
- Introduced through: vite@4.5.14
Detailed paths
-
Introduced through: kms@nasa/kms › vite@4.5.14 › esbuild@0.18.20Remediation: Upgrade to vite@7.3.6.
Overview
esbuild is an An extremely fast JavaScript and CSS bundler and minifier.
Affected versions of this package are vulnerable to Resources Downloaded over Insecure Protocol in the installFromNPM process. An attacker can execute arbitrary code with the privileges of the Deno process by supplying a malicious binary through control of the NPM_CONFIG_REGISTRY environment variable.
Remediation
Upgrade esbuild to version 0.28.1 or higher.
References
high severity
new
- Vulnerable module: vite
- Introduced through: vite@4.5.14
Detailed paths
-
Introduced through: kms@nasa/kms › vite@4.5.14Remediation: Upgrade to vite@6.4.3.
Overview
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Directory Traversal due to improper checks for file system paths on Windows platforms in isFileLoadingAllowed() function. An attacker can obtain sensitive file contents by bypassing path restrictions using NTFS alternate data streams or 8.3 short name compatibility features. This is only exploitable if the development server is explicitly exposed to the network, the sensitive file exists in the allowed directories, and the server is running on Windows with the file located on an NTFS volume or a volume with 8.3 short name generation enabled.
Details
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.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
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
Note %2e is the URL encoded version of . (dot).
- 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.
The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:
2018-04-15 22:04:29 ..... 19 19 good.txt
2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
Upgrade vite to version 6.4.3, 7.3.5, 8.0.16 or higher.
References
medium severity
- Vulnerable module: vite
- Introduced through: vite@4.5.14
Detailed paths
-
Introduced through: kms@nasa/kms › vite@4.5.14Remediation: Upgrade to vite@6.4.2.
Overview
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Directory Traversal via the handling of .map files in the dev server when resolving file paths. An attacker can access sensitive files outside the project root by injecting ../ segments into the URL, provided the files are valid source map JSON and the server is explicitly exposed to the network with predictable .map file paths.
Note:
This is only exploitable if the dev server is started with the --host flag or the server.host configuration option, and sensitive content exists in predictable .map files.
Details
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.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
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
Note %2e is the URL encoded version of . (dot).
- 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.
The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:
2018-04-15 22:04:29 ..... 19 19 good.txt
2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
Upgrade vite to version 6.4.2, 7.3.2, 8.0.5 or higher.
References
medium severity
- Vulnerable module: vite
- Introduced through: vite@4.5.14
Detailed paths
-
Introduced through: kms@nasa/kms › vite@4.5.14Remediation: Upgrade to vite@5.4.21.
Overview
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Directory Traversal via the server.fs.deny function. An attacker can access restricted files by appending a backslash to the URL when the development server is running on Windows and is explicitly exposed to the network.
Note:
This is only exploitable if the server is explicitly exposed to the network using the command line parameter --host or the config option server.host.
PoC
npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env\ http://localhost:5173
Details
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.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
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
Note %2e is the URL encoded version of . (dot).
- 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.
The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:
2018-04-15 22:04:29 ..... 19 19 good.txt
2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
Upgrade vite to version 5.4.21, 6.4.1, 7.0.8, 7.1.11 or higher.
References
low severity
- Vulnerable module: vite
- Introduced through: vite@4.5.14
Detailed paths
-
Introduced through: kms@nasa/kms › vite@4.5.14Remediation: Upgrade to vite@5.4.20.
Overview
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Relative Path Traversal via improper enforcement of server.fs settings. An attacker can access arbitrary HTML files on the server by sending crafted requests to the preview server.
Note:
This is only exploitable if the server is explicitly exposed to the network using the --host flag or the server.host configuration option, and the application uses appType set to 'spa' (default) or 'mpa'.
Remediation
Upgrade vite to version 5.4.20, 6.3.6, 7.0.7, 7.1.5 or higher.