CVE-2024-10624: Gradio Vulnerable to Denial of Service (DoS) via Crafted HTTP Request
The `gr.Datetime` component in Gradio 4.38.0 through 5.0.0-beta.2 checks input with a regular expression that takes polynomial time on crafted strings. One HTTP request can drive the Gradio process to 100% CPU. The advisory lists no patched version.
Published Mar 20, 2025 · Updated Oct 15, 2025 · Analysis Nov 1, 2026
What an attacker can do
In gradio/components/datetime.py, the component validates user input against this pattern: ^(?:\s*now\s*(?:-\s*(\d+)\s*([dmhs]))?)?\s*$. The repeated \s* groups around optional parts let Python's default regex engine backtrack heavily on a long run of whitespace followed by a character that breaks the match. Match time grows polynomially with input length.
An attacker sends a crafted value for a datetime field in an HTTP request. The worker thread spends all its CPU time in the regex and requests queue behind it. The CVSS 3.0 vector (7.5) says network, no privileges, no interaction, availability only. Any Gradio app that uses gr.Datetime and is reachable by untrusted users can be slowed or stalled by a few requests, which affects all of its users. There is no data exposure or code execution.
Who is affected
The gradio package on PyPI from 4.38.0 up to and including 5.0.0-beta.2. The reference code is commit 98cbcae. Only apps that use the gr.Datetime component are exposed. Check your version:
pip show gradioThen search your code for gr.Datetime.
gradio
- Ecosystem
- PyPI
- Affected
- >= 4.38.0, <= 5.0.0-beta.2
- Fixed in
- No patched version yet
- Check
pip show gradio
How to fix it
The advisory lists no patched version. Check Gradio releases after 5.0.0-beta.2 and their notes for changes to datetime.py. The sources name no workaround. General mitigations: remove gr.Datetime from public apps or swap it for a plain textbox you validate yourself, cap request size and rate at your reverse proxy, and run the app with a CPU limit and automatic restart.
How to tell if you were hit
Look for sustained 100% CPU in the Gradio process with few active requests, and for requests that hang or time out. In access logs, look for requests to the app's API routes with unusually long datetime field values made up mostly of whitespace. A process stuck inside the regex shows up in a Python stack dump (for example from py-spy dump) at gradio/components/datetime.py.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the gradio-app/gradio repository, affecting the gr.Datetime component. The affected version is git commit 98cbcae. The vulnerability arises from the use of a regular expression ^(?:\s*now\s*(?:-\s*(\d+)\s*([dmhs]))?)?\s*$ to process user input. In Python's default regex engine, this regular expression can take polynomial time to match certain crafted inputs. An attacker can exploit this by sending a crafted HTTP request, causing the gradio process to consume 100% CPU and potentially leading to a Denial of Service (DoS) condition on the server.
Questions
- Is there a fixed Gradio version for CVE-2024-10624?
The advisory lists none. It covers 4.38.0 through 5.0.0-beta.2. Check newer releases and their notes.
- Do I need to use gr.Datetime to be affected?
Yes. The flaw sits in the regular expression of that component, so apps without it are not described as affected.
- Can this lead to data theft?
No. The advisory rates availability only.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Gradio vulnerabilities
All Gradio entriesCVE-2026-49119
Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks
high7.5Jul 1, 2026CVE-2026-10783
Gradio: Audio cache key ignores metadata when saving numpy audio outputs
low2.5Jun 4, 2026CVE-2026-48545
Gradio contains a cookie injection vulnerability
high6.8May 27, 2026CVE-2026-27167
Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
lowMar 1, 2026CVE-2026-28414
Gradio is Vulnerable to Absolute Path Traversal on Windows with Python 3.13+
high7.5Mar 1, 2026CVE-2026-28415
Gradio has an Open Redirect in its OAuth Flow
medium4.3Mar 1, 2026
