Arbitrary Local File Read via Component Method Invocation in gradio-app/gradio
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2024-1561
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 15:31 UTC · Revision 1
Source evidence
Arbitrary Local File Read via Component Method Invocation in gradio-app/gradio
core-osv · Original sourcePublished 16 Apr 2024, 00:00 UTC
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.
osv:CVE-2024-1561
Complete source record
{
"id": "fab6e38e366aacc9f0e77ded72eda01b20742521d4bb4b7c22e4110f573ba707",
"url": "https://osv.dev/vulnerability/CVE-2024-1561",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Arbitrary Local File Read via Component Method Invocation in gradio-app/gradio",
"summary": "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.",
"evidence": "osv:CVE-2024-1561",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2024-1561",
"aliases": [
"CVE-2024-1561",
"GHSA-g9cj-cfpp-4g2x",
"PYSEC-2026-1415"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/gradio-app/gradio",
"type": "GIT",
"events": [
{
"introduced": "227221f88755240798ca2071bd1a0d165f5a82e7"
},
{
"fixed": "3a0a11cf42fd8a5eae80599035ac618f8ff34404"
},
{
"fixed": "24a583688046867ca8b8b02959c441818bdb34a2"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:gradio_project:gradio:*:*:*:*:*:python:*:*",
"range": [
{
"introduced": "4.12.0"
},
{
"fixed": "4.13.0"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "24a583688046867ca8b8b02959c441818bdb34a2"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"gradio_client@0.8.0",
"gradio@4.12.0",
"@gradio/video@0.2.4",
"@gradio/uploadbutton@0.3.5",
"@gradio/upload@0.5.7",
"@gradio/model3d@0.4.12",
"@gradio/imageeditor@0.2.1",
"@gradio/image@0.5.4",
"@gradio/gallery@0.4.15",
"@gradio/file@0.4.4",
"@gradio/dataset@0.1.14",
"@gradio/dataframe@0.4.4",
"@gradio/code@0.3.4",
"@gradio/client@0.9.4",
"@gradio/chatbot@0.5.6",
"@gradio/button@0.2.14",
"@gradio/audio@0.6.4"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-1561.json"
}
}
],
"modified": "2026-10-28T02:30:36.906397029Z",
"provider": "osv",
"references": [
"https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338",
"https://www.gradio.app/changelog#4-13-0",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/1xxx/CVE-2024-1561.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-1561",
"https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2"
],
"provider_metadata": {
"cwe_ids": [
"CWE-29"
],
"cna_assigner": "@huntr_ai",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/1xxx/CVE-2024-1561.json"
}
},
"related_cves": [
{
"value": "CVE-2024-1561",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504121,
"published_at": "2024-04-16T00:00:15.906+00:00"
}