CrewAI Vulnerabilities Allow Remote Code Execution
Multiple vulnerabilities in CrewAI, an open-source multi-agent orchestration framework, can be exploited by attackers through prompt injection to execute arbitrary code and perform other malicious activities, potentially leading to system compromise.
CrewAI, an open-source multi-agent orchestration framework based on Python, is vulnerable to a chain of exploits that can lead to remote code execution. Discovered by Yarden Porat of Cyata, these vulnerabilities (CVE-2026-2275, CVE-2026-2286, CVE-2026-2287, CVE-2026-2285) are linked to the Code Interpreter tool, which allows users to execute Python code within a Docker container. Attackers can leverage prompt injection to exploit these bugs, escaping the sandbox environment and executing arbitrary code on the host machine. The vulnerabilities are due to improper default configurations and insufficient validation. Although patches are in development, mitigation involves restricting the Code Interpreter tool, disabling code execution flags, and sanitizing inputs.
Attack Chain
- Attacker injects malicious prompts into a CrewAI agent that utilizes the Code Interpreter tool.
- CVE-2026-2275 is exploited, causing the Code Interpreter tool to fall back to SandboxPython when Docker is inaccessible, potentially enabling arbitrary C function calls.
- Successful exploitation of CVE-2026-2275 allows the attacker to trigger CVE-2026-2286, a server-side request forgery (SSRF) bug, by manipulating the RAG search tools with malicious URLs, potentially retrieving content from internal services.
- CVE-2026-2287 is exploited by bypassing Docker runtime checks and falling back to an insecure sandbox setting, enabling remote code execution.
- The attacker leverages CVE-2026-2285, an arbitrary local file read vulnerability in the JSON loader tool, to access sensitive files on the server by injecting malicious file paths.
- The attacker chains the exploits together to escape the Docker sandbox.
- Arbitrary code is executed on the host machine.
- The attacker steals credentials or achieves other objectives, such as persistent access or data exfiltration.
Impact
Successful exploitation of these vulnerabilities allows attackers to escape the sandbox environment and execute code on the host machine or read files from its file system, potentially leading to credential theft, data breaches, and complete system compromise. While the specific number of victims is unknown, any system using CrewAI with the Code Interpreter tool is potentially at risk. Targeted sectors would include organizations leveraging AI and multi-agent systems for automation and task management.
Recommendation
- Restrict or remove the Code Interpreter tool to eliminate the primary attack vector as described in the overview.
- Disable the code execution flag in agent configurations unless absolutely necessary, as highlighted in the overview.
- Limit agent exposure to untrusted input and implement strict input sanitization to prevent prompt injection attacks as mentioned in the attack chain.
- Prevent fallback to insecure sandbox modes to mitigate the risk associated with CVE-2026-2275 and CVE-2026-2287 as described in the attack chain.
- Monitor for unexpected file access attempts that could indicate exploitation of CVE-2026-2285, using a file_event rule.
- Implement network monitoring to detect and block potential SSRF attacks related to CVE-2026-2286 targeting internal or cloud services, using a network_connection rule.
Detection coverage 3
Detect CrewAI Sandbox Escape via Arbitrary File Read
highDetects attempts to read arbitrary files on the server via the CrewAI JSON loader tool vulnerability (CVE-2026-2285), indicating a potential sandbox escape.
Detect CrewAI SSRF Attempts
mediumDetects potential Server-Side Request Forgery (SSRF) attempts related to CVE-2026-2286 by monitoring network connections initiated by CrewAI processes to internal or cloud services.
Detect SandboxPython Fallback
highDetects the fallback to SandboxPython due to Docker inaccessibility, which may indicate CVE-2026-2275 exploitation
Detection queries are kept inside the platform. Get full rules →