# CVE-2024-1540: Command Injection in gradio-app/gradio via deploy+test-visual.yml workflow

- Severity: High 8.6 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.98%, higher than 81% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-03-27T15:54:27.999Z
- Modified: 2026-09-10T03:49:18.820Z
- Also known as: GHSA-xcgp-r7r8-2hc9
- Weaknesses: CWE-77
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- gradio-app gradio-app/gradio: from unspecified before N/A
- gradio_app gradio_app_gradio: up to *
- gradio (PyPI): before 4.18.0
- gradio_project gradio: before 2024-02-09

## Every score

- @huntr_ai: CVSS:3.0 8.6 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L`
- GitHub: CVSS:3.0 8.6 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L`
- NVD: CVSS:3.1 8.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N`

## References

- <https://huntr.com/bounties/0e39e974-9a66-476f-91f5-3f37abb03d77> (exploit, third-party-advisory, web)
- <https://github.com/gradio-app/gradio/commit/d56bb28df80d8db1f33e4acf4f6b2c4f87cb8b28> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-1540> (advisory)
- <https://github.com/gradio-app/gradio> (package)

## Sources

- CVE List: [CVE-2024-1540](https://www.cve.org/CVERecord?id=CVE-2024-1540), CVE Terms of Use, modified 2024-08-21
- GitHub Advisory Database: [GHSA-xcgp-r7r8-2hc9](https://github.com/advisories/GHSA-xcgp-r7r8-2hc9), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-1540](https://nvd.nist.gov/vuln/detail/CVE-2024-1540), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-1540 · Whole record: https://cve.day/CVE-2024-1540.json · Rebuilt by cve.day 2026-11-25T22:58:37.987Z
