CVE-2025-5320: Gradio: CORS origin bypass in ML UI handler
GHSA-wmjh-cpqj-4v6x LOW PoC AVAILABLE CISA: TRACK*Low-severity CORS origin validation flaw in Gradio <= 5.29.1 that could allow cross-origin requests to bypass CORS restrictions on exposed ML interfaces. High attack complexity (AC:H) and no confidentiality impact make this low priority, but teams with publicly-exposed Gradio demos should restrict access behind authentication or VPN until a patch is released. No patch is currently available; vendor did not respond to disclosure.
Risk Assessment
Low risk. CVSS 3.7 with high attack complexity limits practical exploitability — EPSS of 0.00036 confirms negligible exploitation probability in the wild. Impact is bounded to limited integrity violation (I:L); no data exfiltration or availability impact per CVSS vector. Primary concern is for organizations exposing Gradio instances on public networks without an authentication layer, which is common in ML demo and prototype environments. Not in CISA KEV.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| gradio | pip | >= 5.0.0, <= 5.29.1 | No patch |
Do you use gradio? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
No patch available yet — monitor gradio-app/gradio releases for a fix targeting >= 5.29.2.
-
Immediately restrict Gradio interfaces to internal networks or VPN — do not expose publicly without auth.
-
Place Gradio behind an authentication proxy (Clerk, OAuth2 proxy, nginx auth_request).
-
Add explicit CORS allowlist via server configuration overriding default behavior.
-
Monitor web access logs for anomalous Origin headers, especially requests with localhost or 127.x origins from non-local IPs.
-
For critical deployments, consider downgrading to a pre-5.x version as a temporary measure if auth overlay is not feasible.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-5320?
Low-severity CORS origin validation flaw in Gradio <= 5.29.1 that could allow cross-origin requests to bypass CORS restrictions on exposed ML interfaces. High attack complexity (AC:H) and no confidentiality impact make this low priority, but teams with publicly-exposed Gradio demos should restrict access behind authentication or VPN until a patch is released. No patch is currently available; vendor did not respond to disclosure.
Is CVE-2025-5320 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-5320, increasing the risk of exploitation.
How to fix CVE-2025-5320?
1. No patch available yet — monitor gradio-app/gradio releases for a fix targeting >= 5.29.2. 2. Immediately restrict Gradio interfaces to internal networks or VPN — do not expose publicly without auth. 3. Place Gradio behind an authentication proxy (Clerk, OAuth2 proxy, nginx auth_request). 4. Add explicit CORS allowlist via server configuration overriding default behavior. 5. Monitor web access logs for anomalous Origin headers, especially requests with localhost or 127.x origins from non-local IPs. 6. For critical deployments, consider downgrading to a pre-5.x version as a temporary measure if auth overlay is not feasible.
What systems are affected by CVE-2025-5320?
This vulnerability affects the following AI/ML architecture patterns: ML demo interfaces, model serving, inference endpoints.
What is the CVSS score for CVE-2025-5320?
CVE-2025-5320 has a CVSS v3.1 base score of 3.7 (LOW). The EPSS exploitation probability is 0.11%.
Technical Details
NVD Description
A vulnerability classified as problematic has been found in gradio-app gradio up to 5.29.1. This affects the function is_valid_origin of the component CORS Handler. The manipulation of the argument localhost_aliases leads to erweiterte Rechte. It is possible to initiate the attack remotely. The complexity of an attack is rather high. The exploitability is told to be difficult. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
Exploitation Scenario
An adversary identifies a public-facing Gradio ML demo (e.g., a LLM chatbot, image classifier, or data processing tool). They craft a malicious HTML page that uses JavaScript to make cross-origin fetch requests to the Gradio API, manipulating the `localhost_aliases` parameter to pass the `is_valid_origin` check. A victim with active session access to the Gradio instance (e.g., a data scientist or internal user) visits the attacker's page. The browser, deceived by the bypassed CORS policy, sends the request with session credentials, allowing the attacker to invoke model inference, exfiltrate model outputs, or interact with the Gradio interface on behalf of the authenticated user.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N References
Timeline
Related Vulnerabilities
CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradio CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradio CVE-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradio CVE-2024-0964 9.4 Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradio CVE-2023-34239 9.1 Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio
AI Threat Alert