Executive brief
PlotAI is a Python library that uses large language models to generate code for creating data visualizations. A vulnerability in the code execution engine fails to validate code generated by the AI model, allowing an attacker to execute arbitrary Python code on systems using the library. This could result in complete system compromise, data theft, or malware installation.
Technical details
PlotAI contains an unsafe use of the exec() function in its code executor that directly executes Python code generated by an LLM without validation or sanitization. The vulnerability is triggered when the LLM output contains arbitrary Python code instructions. An attacker can craft malicious prompts to the LLM to generate hostile code that the exec() function will execute with full privileges of the Python process. No authentication is required; any user invoking PlotAI is at risk. The vendor has disabled the vulnerable exec() call by commenting it out in version 0.0.7 and later, requiring users to explicitly uncomment and accept the security risk if they need this functionality.
Affected products
- PlotAI PlotAI 0.0.0 through 0.0.6
Timeline
- 2025-03-10: disclosed
- 2025-03-10: patched: Version 0.0.7 released with exec() call commented out