一、 漏洞 CVE-2024-1561 基础信息
漏洞信息
                                        # 通过 gradio-app/gradio 组件方法调用读取任意本地文件

## 漏洞概述
在 gradio-app/gradio 中发现了一个漏洞,攻击者可以通过 `/component_server` 端点调用 `Component` 类的任何方法,并使用受攻击者控制的参数。具体来说,通过利用 `Block` 类中的 `move_resource_to_block_cache()` 方法,攻击者可以将文件系统中的任何文件复制到临时目录并随后获取这些文件。

## 影响版本
未指定具体版本

## 漏洞细节
1. 攻击者可以利用 `/component_server` 端点来调用 `Component` 类的方法。
2. 利用 `Block` 类中的 `move_resource_to_block_cache()` 方法,攻击者可以将任意文件复制到临时目录,并读取这些文件。
3. 该漏洞导致未经授权的本地文件读取访问,当应用程序通过 `launch(share=True)` 暴露到互联网时,远程攻击者可以读取主机上的文件。
4. 在 `huggingface.co` 上托管的 Gradio 应用程序也会受到影响,可能导致敏感信息如 API 密钥和凭据的暴露。

## 影响
- 未经授权的本地文件读取,特别是当应用程序公开在互联网上时。
- 暴露托管在 `huggingface.co` 上的应用程序中的敏感信息,如 API 密钥和环境变量中的凭证。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
Arbitrary Local File Read via Component Method Invocation in gradio-app/gradio
来源:美国国家漏洞数据库 NVD
漏洞描述信息
An issue was discovered in gradio-app/gradio, where the `/component_server` endpoint improperly allows the invocation of any method on a `Component` class with attacker-controlled arguments. Specifically, by exploiting the `move_resource_to_block_cache()` method of the `Block` class, an attacker can copy any file on the filesystem to a temporary directory and subsequently retrieve it. This vulnerability enables unauthorized local file read access, posing a significant risk especially when the application is exposed to the internet via `launch(share=True)`, thereby allowing remote attackers to read files on the host machine. Furthermore, gradio apps hosted on `huggingface.co` are also affected, potentially leading to the exposure of sensitive information such as API keys and credentials stored in environment variables.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
路径遍历:’..filename’
来源:美国国家漏洞数据库 NVD
漏洞标题
Gradio 安全漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Gradio是一个开源 Python 库,是通过友好的 Web 界面演示机器学习模型的方法。 Gradio 存在安全漏洞,该漏洞源于端点不正确地允许调用类上的任何方法,允许未经授权的本地文件读取访问,可能导致敏感信息泄露。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
其他
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2024-1561 的公开POC
# POC 描述 源链接 神龙链接
1 Poc for CVE-2024-1561 affecting Gradio 4.12.0 https://github.com/DiabloHTB/CVE-2024-1561 POC详情
2 Nuclei Templates https://github.com/DiabloHTB/Nuclei-Template-CVE-2024-1561 POC详情
3 Local file read by calling arbitrary methods of Components class between Gradio versions 4.3-4.12 https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-1561.yaml POC详情
4 https://github.com/vulhub/vulhub/blob/master/gradio/CVE-2024-1561/README.md POC详情
5 None https://github.com/Threekiii/Awesome-POC/blob/master/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80%E6%BC%8F%E6%B4%9E/Python%20Gradio%20%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96%E6%BC%8F%E6%B4%9E%20CVE-2024-1561.md POC详情
三、漏洞 CVE-2024-1561 的情报信息