CVE-2025-0187

7.5 HIGH

📋 TL;DR

A Denial of Service vulnerability in gradio-app/gradio version 0.39.1 allows attackers to crash servers by uploading files with excessively long filenames. This affects any system running the vulnerable gradio version with file upload functionality enabled. The vulnerability makes servers unresponsive to legitimate users.

💻 Affected Systems

Products:
  • gradio-app/gradio
Versions: 0.39.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations with file upload functionality enabled. The vulnerability is in the form-data parsing component.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability requiring server restart, potentially disrupting critical applications built on gradio.

🟠

Likely Case

Temporary service disruption affecting all users until the server is restarted or the malicious request stops.

🟢

If Mitigated

Minimal impact with proper input validation and rate limiting in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires only the ability to send HTTP requests with malformed form-data. No authentication or special privileges needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.39.2 or later

Vendor Advisory: https://huntr.com/bounties/77f3ed54-9e1c-4d9f-948f-ee6f82e2fe24

Restart Required: No

Instructions:

1. Update gradio using pip: pip install --upgrade gradio>=0.39.2
2. Verify the update with: pip show gradio
3. Restart any running gradio applications

🔧 Temporary Workarounds

Input Validation via Reverse Proxy

all

Configure a reverse proxy (nginx, Apache) to reject requests with excessively long filenames before they reach gradio.

nginx config: limit client_header_buffer_size and large_client_header_buffers
Apache config: LimitRequestFieldSize 4096

Rate Limiting

all

Implement rate limiting on file upload endpoints to prevent DoS attacks.

Use web server rate limiting modules or application-level rate limiting

🧯 If You Can't Patch

  • Disable file upload functionality if not required
  • Implement WAF rules to block requests with abnormally long filenames

🔍 How to Verify

Check if Vulnerable:

Check gradio version: pip show gradio | grep Version. If version is 0.39.1, system is vulnerable.

Check Version:

pip show gradio | grep Version

Verify Fix Applied:

After updating, verify version is 0.39.2 or later: pip show gradio | grep Version

📡 Detection & Monitoring

Log Indicators:

  • HTTP 413 errors
  • Server restart logs
  • Unusually long filenames in access logs
  • Increased error rates on upload endpoints

Network Indicators:

  • Spike in upload requests with similar patterns
  • Abnormally large Content-Length headers for filenames

SIEM Query:

source="web_logs" filename_length>255 OR http_status=413

🔗 References

📤 Share & Export