CVE-2024-1540: Gradio Gradio's CI Vulnerable To Command Vulnerability
HIGHCVE-2024-1540 is a HIGH (CVSS 8.6) gradio's ci vulnerable to command vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio's ci vulnerable to command injection. Remediation is available by upgrading affected packages to version 4.18.0.
CVE-2024-1540 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2024-1540
To remediate this vulnerability, upgrade all affected Gradio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install gradio>=4.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show gradio
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-1540, inspect your installed packages using pip:
pip show gradio
Analyze the terminal output to locate any version of Gradio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.18.0), your application is affected.
Note: The pip show gradio command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Gradio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-1540 Affected Gradio Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gradio
|
PyPI |
< 4.18.0
|
4.18.0
|
References
Frequently Asked Questions
What is CVE-2024-1540?
Which Gradio versions are affected?
What version fixes CVE-2024-1540?
Is gradio affected?
What is the CVSS score of CVE-2024-1540?
What CWE is associated with CVE-2024-1540?
How can I check PyPI dependencies for CVE-2024-1540?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xcgp-r7r8-2hc9",
"modified" : "2024-04-16T15:50:40Z",
"published" : "2024-03-27T18:32:38Z",
"withdrawn" : "2024-03-27T21:57:19Z",
"aliases" : [ "CVE-2024-1540" ],
"summary" : "Gradio's CI vulnerable to Command Injection",
"details" : "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 an action definition which is evaluated and substituted before script execution. Remediation involves setting untrusted input values to intermediate environment variables to prevent direct influence on script generation.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gradio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-1540"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/commit/d56bb28df80d8db1f33e4acf4f6b2c4f87cb8b28"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gradio-app/gradio"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/0e39e974-9a66-476f-91f5-3f37abb03d77"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-27T21:56:42Z",
"nvd_published_at" : "2024-03-27T16:15:09Z"
}
}