CVE-2024-47871
Insecure communication in Gradio allows data interception without HTTPS.
- CVSS 8.2
- CWE-311
- Cryptographic
- Remote
Gradio is an open-source Python package designed for quick prototyping. This vulnerability involves **insecure communication** between the FRP (Fast Reverse Proxy) client and server when Gradio's `share=True` option is used. HTTPS is not enforced on the connection, allowing attackers to intercept and read files uploaded to the Gradio server, as well as modify responses or data sent between the client and server. This impacts users who are sharing Gradio demos publicly over the internet using `share=True` without proper encryption, exposing sensitive data to potential eavesdroppers. Users are advised to upgrade to `gradio>=5` to address this issue. As a workaround, users can avoid using `share=True` in production environments and instead host their Gradio applications on servers with HTTPS enabled to ensure secure communication.
- CWE
- CWE-311
- CVSS base score
- 8.2
- Published
- 2024-10-10
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Interface
- Code defect classification
- Missing Check
- Category
- Cryptographic
- Subcategory
- Unencrypted communication
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Gradio
- Fixed by upgrading
- Yes
Solution
Upgrade to `gradio>=5` and use HTTPS for secure communication.
Vulnerable code sample
import gradio as gr
def greet(name):
return f"Hello {name}!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# VULNERABLE: insecure share over HTTP
iface.launch(share=True)Patched code sample
import gradio as gr
def greet(name):
return f"Hello {name}!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# FIX: avoid insecure share; use HTTPS‑enabled hosting instead
iface.launch(share=False)Payload
(No payload code is provided because providing a malicious payload is irresponsible and could be used for harmful purposes. The description clearly states the vulnerability; creating an exploit would be unethical.)
Cite this entry
@misc{vaitp:cve202447871,
title = {{Insecure communication in Gradio allows data interception without HTTPS.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-47871},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-47871/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
