cbcvebase.
CVE-2024-1561
published 2024-04-16

CVE-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
VendorProductVersion rangeFixed in
gradio-appgradio-app_gradio>= unspecified < 4.13.04.13.0
gradio_projectgradio>= 0 < 4.13.04.13.0
gradio_projectgradio>= 4.12.0 < 4.13.04.13.0

Detection & IOCsextracted from sources · hover to see the quote

url/component_server
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.