CVE-2024-47165
📋 TL;DR
This CVE allows attackers to make unauthorized requests to locally deployed Gradio servers from sandboxed iframes or other sources with a null origin. This can lead to data theft including authentication tokens and uploaded files. It primarily affects users running Gradio locally with basic authentication.
💻 Affected Systems
- Gradio
📦 What is this software?
Gradio by Gradio Project
⚠️ Risk & Real-World Impact
Worst Case
Attackers steal authentication tokens and sensitive user data, potentially gaining unauthorized access to the Gradio application and underlying systems.
Likely Case
Data exfiltration of uploaded files or authentication tokens from locally deployed Gradio instances with basic authentication enabled.
If Mitigated
No impact when null origin is properly excluded from allowed origins or when upgraded to patched versions.
🎯 Exploit Status
Exploitation requires attacker to trick user into visiting malicious site with sandboxed iframe targeting local Gradio instance.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: gradio>=5.0
Vendor Advisory: https://github.com/gradio-app/gradio/security/advisories/GHSA-89v2-pqfv-c5r9
Restart Required: Yes
Instructions:
1. Upgrade Gradio using pip: pip install --upgrade gradio>=5.0
2. Restart your Gradio application
3. Verify the version with: pip show gradio
🔧 Temporary Workarounds
Remove null from localhost_aliases
allManually modify the localhost_aliases list to exclude 'null' as a valid origin
Edit your Gradio deployment code to remove 'null' from the localhost_aliases list
🧯 If You Can't Patch
- Disable basic authentication on local Gradio deployments
- Implement additional network segmentation to isolate Gradio instances
🔍 How to Verify
Check if Vulnerable:
Check if running Gradio version <5.0 and if localhost_aliases includes 'null' in your deployment
Check Version:
pip show gradio | grep Version
Verify Fix Applied:
Verify Gradio version is >=5.0 and confirm 'null' is not in localhost_aliases
📡 Detection & Monitoring
Log Indicators:
- Requests with Origin: null header to Gradio endpoints
- Unauthorized access attempts to authenticated endpoints
Network Indicators:
- HTTP requests with null origin to local Gradio ports (typically 7860)
SIEM Query:
source_port:7860 AND http.headers.origin:"null"