CVE-2022-24770: Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging
Summary
CVE-2022-24770: Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging. Affects gradio versions < 2.8.11. Fixed in 2.8.11. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Gradio is an open-source library that provides a simple interface for creating customizable UI components for machine learning models. It allows developers to quickly build interactive interfaces for their models, enabling users to input data and visualize the model's output. Gradio includes a flagging functionality that saves input/output data into a CSV file on the developer's computer. This feature is intended to help developers analyze and debug their models. However, a vulnerability in this functionality allows an attacker to save arbitrary text, including commands, into the CSV file. If the file is opened with a program like MS Excel, these commands can be automatically executed, leading to arbitrary command execution on the user's computer.
Vulnerability Detail
The vulnerability in Gradio's flagging functionality arises from the lack of proper neutralization of formula elements in a CSV file. When saving data to the CSV file, the library does not escape the text, allowing arbitrary commands to be injected. If a user opens the CSV file with a program like MS Excel, the commands are automatically executed, potentially leading to unauthorized actions on the user's computer. The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary commands with the privileges of the user running the program.
How To Fix
Latest published version: 6.30.0 as of 22 Oct 2026
pip install --upgrade "gradio==6.30.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.8.11
This is the first release that contains the fix.
pip install --upgrade "gradio==2.8.11"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating to the latest version of Gradio is not possible, users can mitigate the risk by avoiding opening CSV files generated by Gradio with programs like MS Excel or similar spreadsheet applications. Instead, they should use a text editor or a specialized CSV viewer that does not automatically execute commands.
Conclusion
The vulnerability in Gradio's flagging functionality allows an attacker to inject arbitrary commands into a CSV file, which can be automatically executed when opened with programs like MS Excel. This can lead to unauthorized command execution on the user's computer. It is recommended to update Gradio to version 2.8.11 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for gradio →
FAQ
Gradio is an open-source library that provides a simple interface for creating customizable UI components for machine learning models.
The flagging functionality in Gradio allows developers to save input/output data into a CSV file for analysis and debugging purposes.
The vulnerability arises from the lack of proper neutralization of formula elements in the CSV file. This allows an attacker to inject arbitrary commands that can be automatically executed when the file is opened with programs like MS Excel.
The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary commands with the privileges of the user running the program.
To fix the vulnerability, update your Gradio installation to version 2.8.11 or later.
References
Related vulnerabilities
Recent vulnerabilities recorded for gradio.