CVE-2026-4997
Description
A security flaw has been discovered in Sinaptik AI PandasAI up to 3.0.0. This affects the function is_sql_query_safe of the file pandasai/helpers/sql_sanitizer.py. Performing a manipulation results in path traversal. The attack may be initiated remotely. The exploit has been released to the public and may be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A path traversal vulnerability in PandasAI ≤3.0.0 allows remote arbitrary file read by bypassing SQL safety checks via DuckDB's read_csv_auto() function.
Vulnerability
Details
The vulnerability resides in the is_sql_query_safe() function within pandasai/helpers/sql_sanitizer.py. This function is designed to validate SQL queries generated by large language models (LLMs) before execution, ensuring they are safe. However, it only checks for a blocklist of keywords such as INSERT, DROP, DELETE, etc., and fails to block DuckDB-specific table functions like read_csv_auto(), read_parquet(), and read_json(). As a result, a SELECT query that includes these functions can pass all safety checks and be executed by DuckDB [1].
Exploitation
Method
An attacker can craft a query such as SELECT * FROM read_csv_auto('/etc/passwd', header=False, sep=':') which is a valid SELECT statement and does not contain any blocked keywords. The query is then executed by the LocalDatasetLoader.execute_query() method, which hands the validated query directly to DuckDB for execution without further scrutiny [1]. The attack can be initiated remotely, and the vendor did not respond to disclosures [1].
Impact
Successful exploitation allows an attacker to read arbitrary files from the server's filesystem, including sensitive files like /etc/passwd, .env files containing API keys, or SSH private keys. This can lead to further compromise of the server or associated systems [1].
Mitigation
Status
As of the advisory date, the vendor has not responded to the disclosure, and no official patch is available for PandasAI up to version 3.0.0. Users are advised to restrict access to the affected endpoints or implement additional input validation until a fix is released [1].
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1- Range: <=3.0.0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
0No linked articles in our index yet.