CVE-2023-39661
Pandas-ai v0.9.1 and earlier have a remote code execution vulnerability via the _is_jailbreak function
- CVSS 9.8
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
- Input Validation and Sanitization
- Remote
An issue in pandas-ai v.0.9.1 and before allows a remote attacker to execute arbitrary code via the _is_jailbreak function.
- CVSS base score
- 9.8
- Published
- 2023-08-15
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- pandas-ai
- Fixed by upgrading
- Yes
Solution
Update pandas-ai to version 0.9.2 or higher.
Vulnerable code sample
def _is_jailbreak(user_input):
# Vulnerable code that allows arbitrary code execution
if user_input == "jailbreak":
exec("print('Executing arbitrary code!')")
return False # No jailbreak detectedPatched code sample
def _is_jailbreak(user_input):
# Restrict the input to prevent code execution
if any(char in user_input for char in [';', '&', '|', '&&', '||', '>', '<', '`']):
raise ValueError("Potentially dangerous characters detected in input.")
return False # No jailbreak detectedCite this entry
@misc{vaitp:cve202339661,
title = {{Pandas-ai v0.9.1 and earlier have a remote code execution vulnerability via the _is_jailbreak function}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2023},
note = {VAITP Python Vulnerability Dataset, entry CVE-2023-39661},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-39661/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
