CVE-2024-47165

5.4 MEDIUM

📋 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

Products:
  • Gradio
Versions: All versions before 5.0
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects local deployments where localhost_aliases includes 'null' as valid origin. Basic authentication increases risk.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: LOW - This primarily affects locally deployed instances, though internet-facing instances with localhost aliases could be vulnerable.
🏢 Internal Only: MEDIUM - Internal deployments using Gradio locally with basic authentication are at risk of data exfiltration.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Manually 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"

🔗 References

📤 Share & Export