A command injection vulnerability exists in the gradio-app/gradio repository, specifically within the 'test-functional.yml' workflow. The vulnerability arises due to improper neutralization of special elements used in a command, allowing for unauthorized modification of the base repository or secrets exfiltration. The issue affects versions up to and including '@gradio/video@0.6.12'. The flaw is present in the workflow's handling of GitHub context information, where it echoes the full name of the head repository, the head branch, and the workflow reference without adequate sanitization. This could potentially lead to the exfiltration of sensitive secrets such as 'GITHUB_TOKEN', 'COMMENT_TOKEN', and 'CHROMATIC_PROJECT_TOKEN'.
The vulnerability results from improper neutralization of special characters in commands executed by GitHub Actions workflow. A workflow without proper sanitization processes GitHub context data: the full source repository name (head repository), branch name (head branch), and workflow reference — passing them directly to shell commands. An attacker can craft a malicious branch or fork name that will be interpreted as a system command, leading to execution of arbitrary code in the CI/CD pipeline context.
An attacker can lead to exfiltration of sensitive secrets stored in the CI/CD environment, including 'GITHUB_TOKEN', 'COMMENT_TOKEN', and 'CHROMATIC_PROJECT_TOKEN' tokens, as well as unauthorized modification of the base repository content.
A patch available in commit a0e70366a8a406fdd80abb21e8c88a3c8e682a2b in the gradio-app/gradio repository should be applied. According to vendor references, it is recommended to update to a version containing the indicated fix and review all workflows for proper sanitization of GitHub context data before using them in shell commands.
The gradio-app/gradio repository in versions up to and including '@gradio/video@0.6.12', using the 'test-functional.yml' workflow.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NGradio Project Gradio
APPGradio Project< 4.29.0
Related vulnerabilities
Code injection w Gradio v4.36.1 via component_meta.py
Path Traversal (LFI) w Gradio poprzez złośliwą wartość JSON w API
Path traversal w Gradio FileExplorer umożliwia odczyt dowolnych plików
Gradio before version 6.15.0 contains a cookie injection vulnerability that allows remote attackers to perform...
Gradio is an open-source Python package designed for quick prototyping. Prior to version 6.7, Gradio apps runn...