CVE-2024-1540 Command Injection in gradio-app/gradio via deploy+test-visual.yml workflow
Attackers can execute unauthorized commands via GitHub Actions workflows, potentially modifying repositories or exfiltrating secrets.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2024-1540?
CVE-2024-1540 is a high-severity command injection vulnerability in Gradio Project Gradio, published on 27 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A command injection vulnerability exists in the deploy+test-visual.yml workflow of the gradio-app/gradio repository, due to improper neutralization of special elements used in a command. This vulnerability allows attackers to execute unauthorized commands, potentially leading to unauthorized modification of the base repository or secrets exfiltration. The issue arises from the unsafe handling of GitHub context information within a `run` operation, where expressions inside `${{ }}` are evaluated and substituted before script execution. Remediation involves setting untrusted input values to intermediate environment variables to prevent direct influence on script generation.
Weakness: CWE-77
Which versions are affected by CVE-2024-1540?
It affects 1 product.
Products include Gradio Project Gradio.
How do I fix CVE-2024-1540?
No fix has been published for CVE-2024-1540 yet. Limit exposure of the affected software until one is available.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2024-1540 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-1540 exists.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Gradio Project Gradio
- CVE-2024-39236 Withdrawn Advisory: Gradio was discovered to contain a code injection vulnerability via the component /gradio/component_meta.py
- CVE-2023-6572 Command Injection in gradio-app/gradio
- CVE-2022-24770 Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging
- CVE-2026-49119 Gradio < 6.16.0 Path Traversal via FileExplorer.preprocess()
- CVE-2025-23042 Gradio Blocked Path ACL Bypass Vulnerability