CVE-2024-0964
📋 TL;DR
CVE-2024-0964 is a critical local file inclusion vulnerability in Gradio that allows remote attackers to read arbitrary files on the server by exploiting a vulnerable user-supplied JSON value in API requests. This affects all Gradio deployments with vulnerable versions exposed to untrusted users. Attackers can potentially access sensitive configuration files, credentials, or other system data.
💻 Affected Systems
- Gradio
📦 What is this software?
Gradio by Gradio Project
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise through reading sensitive files like SSH keys, database credentials, or configuration files leading to lateral movement and data exfiltration.
Likely Case
Unauthorized access to sensitive files containing API keys, tokens, configuration data, or user information stored on the server.
If Mitigated
Limited impact with proper input validation and file access restrictions in place.
🎯 Exploit Status
Exploitation requires sending specially crafted JSON payloads to vulnerable API endpoints.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.19.2
Vendor Advisory: https://github.com/gradio-app/gradio/commit/d76bcaaaf0734aaf49a680f94ea9d4d22a602e70
Restart Required: Yes
Instructions:
1. Update Gradio to version 4.19.2 or later using pip: pip install --upgrade gradio>=4.19.2
2. Restart all Gradio applications and services
3. Verify the update was successful
🔧 Temporary Workarounds
Input Validation Filter
allImplement strict input validation to reject JSON payloads containing file path traversal patterns
Network Restriction
allRestrict network access to Gradio applications to trusted IP ranges only
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block requests containing file path traversal patterns
- Run Gradio applications with minimal file system permissions and in isolated containers
🔍 How to Verify
Check if Vulnerable:
Check Gradio version: python -c "import gradio; print(gradio.__version__)" and compare to 4.19.2
Check Version:
python -c "import gradio; print(gradio.__version__)"
Verify Fix Applied:
Confirm version is 4.19.2 or higher and test API endpoints with malicious payloads to ensure they're rejected
📡 Detection & Monitoring
Log Indicators:
- Unusual file path patterns in API request logs
- Multiple failed attempts to access system files
- Requests containing '../' patterns in JSON payloads
Network Indicators:
- Unusual spikes in API requests to file-related endpoints
- Requests with abnormal JSON structures
SIEM Query:
source="gradio_logs" AND ("../" OR "..\\" OR "/etc/" OR "/root/")