CVE-2024-1561
published 2024-04-16CVE-2024-1561: 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…
PriorityP179high7.5CVSS 3.0
AVNACLPRNUINSUCHINAN
ITWEXPLOITVulnCheck KEV
Exploited in the wild
EPSS
9.24%
94.7th percentile
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.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| gradio-app | gradio-app_gradio | >= unspecified < 4.13.0 | 4.13.0 |
| gradio_project | gradio | >= 0 < 4.13.0 | 4.13.0 |
| gradio_project | gradio | >= 4.12.0 < 4.13.0 | 4.13.0 |
Detection & IOCsextracted from sources · hover to see the quote
command{"component_id": "1", "data": "{{path}}", "fn_name": "move_resource_to_block_cache", "session_hash": "aaaaaaaaaaa"}
path/etc/passwd
url/file=
- →Detect POST requests to /component_server with fn_name set to 'move_resource_to_block_cache' in the JSON body — this is the specific method invocation used to exploit the LFI.
- →Monitor for two-stage attack pattern: POST to /component_server followed by GET /file= to retrieve the copied file from the temporary directory.
- →Use Shodan query 'html:"__gradio_mode__"' to identify exposed Gradio instances that may be vulnerable.
- →Match HTTP 200 responses with Content-Type text/plain from /file= endpoint after exploitation, combined with regex patterns for /etc/passwd or win.ini content.
- →The /component_server endpoint improperly allows invocation of any method on a Component class with attacker-controlled arguments — alert on any fn_name values other than expected UI component methods.
- ·Vulnerability affects Gradio versions 4.3 through 4.12 only; version 4.13.0 patches the issue. Scope detection rules to this version range.
- ·Risk is significantly elevated when the application is exposed via launch(share=True) or hosted on huggingface.co, where environment variables (API keys, credentials) may be exfiltrated.
- ·The exploit is unauthenticated and requires no prior privileges (PR:N, UI:N), making it trivially exploitable on any internet-exposed Gradio instance in the affected version range.
CVSS provenance
nvdv3.07.5HIGHCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vulncheck7.5HIGH
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
gradio vulnerable to Path Traversal
osv·2024-04-16
CVE-2024-1561 [HIGH] gradio vulnerable to Path Traversal
gradio vulnerable to Path Traversal
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
GHSA
gradio vulnerable to Path Traversal
ghsa·2024-04-16
CVE-2024-1561 [HIGH] CWE-29 gradio vulnerable to Path Traversal
gradio vulnerable to Path Traversal
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
VulnCheck
Gradio move_resource_to_block_cache() Method Vulnerability
vulncheck·2024·CVSS 7.5
CVE-2024-1561 [HIGH] Gradio move_resource_to_block_cache() Method Vulnerability
Gradio move_resource_to_block_cache() Method Vulnerability
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 o
No detection rules found.
Nuclei
Gradio 4.3-4.12 - Local File Read
nuclei·CVSS 7.5
CVE-2024-1561 [HIGH] Gradio 4.3-4.12 - Local File Read
Gradio 4.3-4.12 - Local File Read
Local file read by calling arbitrary methods of Components class between Gradio versions 4.3-4.12
Template:
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
No writeups or analysis indexed.
https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338https://www.gradio.app/changelog#4-13-0https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338https://www.gradio.app/changelog#4-13-0
2024-04-16
Published
Exploited in the wild