CVE-2022-24770: Gradio Improper Neutralization Of Formula Elements Vulnerability
HIGHCVE-2022-24770 is a HIGH (CVSS 8.8) improper neutralization of formula elements vulnerability (CWE-1236: Improper Neutralization of Formula Elements in a CSV File) affecting Gradio libraries in the PyPI ecosystem. The issue involves improper neutralization of formula elements in a csv file in gradio flagging. Remediation is available by upgrading affected packages to version 2.8.11.
CVE-2022-24770 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24770
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>=2.8.11
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-2022-24770, 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 2.8.11), 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-1236: Improper Neutralization of Formula Elements in a CSV File, where the product saves user-provided information into a comma-separated value (csv) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by a spreadsheet product. 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-2022-24770 Affected Gradio Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gradio
|
PyPI |
< 2.8.11
|
2.8.11
|
References
Frequently Asked Questions
What is CVE-2022-24770?
Which Gradio versions are affected?
What version fixes CVE-2022-24770?
Is gradio affected?
What is the CVSS score of CVE-2022-24770?
What CWE is associated with CVE-2022-24770?
How can I check PyPI dependencies for CVE-2022-24770?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8xq-q7px-wg8c",
"modified" : "2022-03-18T23:11:43Z",
"published" : "2022-03-18T23:11:43Z",
"aliases" : [ "CVE-2022-24770" ],
"summary" : "Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging",
"details" : "### Impact\nThe `gradio` library has a flagging functionality which saves input/output data into a CSV file on the developer's computer. This can allow a user to save arbitrary text into the CSV file, such as commands. If a program like MS Excel opens such a file, then it automatically runs these commands, which could lead to arbitrary commands running on the user's computer.\n\n### Patches\nThe problem has been patched as of `2.8.11`, which escapes the data saved to the csv with single quotes.\n\n### Workarounds\nIf you are using an older version of `gradio`, don't open csv files generated by `gradio` with Excel or similar spreadsheet programs.\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gradio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.11"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/security/advisories/GHSA-f8xq-q7px-wg8c"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24770"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/pull/817"
}, {
"type" : "WEB",
"url" : "https://github.com/gradio-app/gradio/commit/80fea89117358ee105973453fdc402398ae20239"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gradio-app/gradio"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2022-229.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1236" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-18T23:11:43Z",
"nvd_published_at" : "2022-03-17T21:15:00Z"
}
}