CVE-2024-12366: PandasAI interactive prompt function Remote Code Execution (RCE)
PandasAI 2.4.3 and earlier runs Python or SQL code that an LLM generates from a user's chat prompt. A crafted prompt makes the model emit malicious code that PandasAI executes, giving remote code execution. The vendor added a Security setting and a sandbox, but the advisory lists no patched version.
Published Feb 11, 2025 · Updated Nov 16, 2026 · Analysis Nov 1, 2026
What an attacker can do
PandasAI turns a natural-language question into Python or SQL and runs it. Its checks do not tell a legitimate question from a malicious one. Per the CERT/CC note, NVIDIA's AI Red Team showed that prompt injection can bypass the import restrictions, jailbreak protections and allow-lists, so the model writes code that runs commands instead of explaining data.
The attacker needs access to the chat prompt. If PandasAI sits behind a web app, a chatbot or an API that takes user input, that means any user of it, and the CVSS vector lists no privileges. Code runs with the rights of the host process, which gives access to files, environment variables, API keys and connected databases, and a base to pivot into other services.
The danger rises when data the model reads, such as cell values in a dataframe, comes from untrusted sources. Injected text there can steer the model as well.
Who is affected
pandasai (pip) 2.4.3 and earlier, as the description states; the package data lists versions up to 2.4.2. Check your version:
pip show pandasaiExposed are deployments where users you do not trust can type prompts that PandasAI answers by running generated code.
pandasai
- Ecosystem
- PyPI
- Affected
- <= 2.4.2
- Fixed in
- No patched version yet
- Check
pip show pandasai
How to fix it
The advisory lists no patched version. Per CERT/CC, the vendor SinaptikAI added a Security parameter to the PandasAI configuration with three values: Standard (the default), Advanced (stricter) and None (turns checks off, not recommended). Use Advanced or Standard, never None. The vendor also released a sandbox, described in its privacy and security documentation, that isolates code execution. Run PandasAI inside that sandbox, and limit who can reach the prompt interface.
How to tell if you were hit
Log the code PandasAI generates and review it for imports such as os, subprocess or socket, calls to eval or exec, file reads outside the data, and network access. Watch the host for child processes spawned by the Python process running PandasAI and for outbound connections it does not normally make. Check chat logs for prompts that ask the model to ignore its rules or print code.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
PandasAI uses an interactive prompt function that is vulnerable to prompt injection and run arbitrary Python code that can lead to Remote Code Execution (RCE) instead of the intended explanation of the natural language processing by the LLM. The security controls of PandasAI (2.4.3 and earlier) fail to distinguish between legitimate and malicious inputs, allowing the attackers to manipulate the system into executing untrusted code, leading to untrusted code execution (RCE), system compromise, or pivoting attacks on connected services.
Questions
- Is there a patched PandasAI version for CVE-2024-12366?
None is listed. The vendor added a Security setting and a sandbox. Use the Advanced setting and the sandbox, and restrict prompt access.
- Who reported it?
The CERT/CC note credits NVIDIA's AI Red Team.
- Does the attacker need to be logged in?
The vector lists no privileges, but they need access to the chat prompt. If the prompt is exposed to anonymous users, so is the flaw.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
