CVE-2024-47084

8.3 HIGH

📋 TL;DR

This CVE allows malicious websites to bypass CORS origin validation in Gradio servers when cookies are present, enabling unauthorized requests to local Gradio instances. Attackers could potentially upload files, steal authentication tokens, and access user data. This affects users who have deployed Gradio locally with basic authentication enabled.

💻 Affected Systems

Products:
  • gradio
Versions: All versions <= 4.44
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Requires local Gradio deployment with basic authentication enabled and user visiting malicious website while authenticated.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of local Gradio server allowing file uploads, authentication token theft, and unauthorized data access leading to full system compromise.

🟠

Likely Case

Unauthorized file uploads and data exfiltration from local Gradio instances when users visit malicious websites while authenticated.

🟢

If Mitigated

Minimal impact with proper CORS validation and network segmentation in place.

🌐 Internet-Facing: MEDIUM - Requires user interaction (visiting malicious site) and local Gradio deployment, but exploitation is straightforward.
🏢 Internal Only: LOW - Primarily affects local deployments; internal network exposure reduces risk compared to internet-facing systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user to visit malicious website while authenticated to local Gradio instance. Attack vector is straightforward once conditions are met.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: gradio>4.44

Vendor Advisory: https://github.com/gradio-app/gradio/security/advisories/GHSA-3c67-5hwx-f6wx

Restart Required: Yes

Instructions:

1. Check current Gradio version: pip show gradio
2. Upgrade to patched version: pip install --upgrade gradio>4.44
3. Restart all Gradio applications

🔧 Temporary Workarounds

Manual CORS Middleware Modification

all

Modify CustomCORSMiddleware class to enforce strict CORS validation even when cookies are present

Edit local Gradio server code to bypass condition that skips CORS validation for cookie-containing requests

🧯 If You Can't Patch

  • Disable basic authentication in Gradio configurations
  • Implement network segmentation to isolate Gradio instances from user browsing activities

🔍 How to Verify

Check if Vulnerable:

Check Gradio version: pip show gradio | grep Version. If version <= 4.44, system is vulnerable.

Check Version:

pip show gradio | grep Version

Verify Fix Applied:

Verify upgraded version: pip show gradio | grep Version. Confirm version > 4.44.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected cross-origin requests to Gradio endpoints
  • File uploads from unexpected origins
  • Authentication attempts from non-local sources

Network Indicators:

  • Cross-origin requests to local Gradio ports (typically 7860)
  • POST requests to /upload endpoints from external domains

SIEM Query:

source_port:7860 AND http.method:POST AND NOT src_ip:127.0.0.1

🔗 References

📤 Share & Export