Summary
CVE-2026-51871 is a critical code injection vulnerability (CWE-94) in Devika, an open-source AI software engineering agent, affecting version 1.0. The flaw resides in the Runner.execute function in src/agents/runner/runner.py, which executes LLM-generated content without validation, sanitization, or sandboxing, allowing an unauthenticated, remote attacker to achieve arbitrary code execution with the privileges of the Devika process. The vulnerability carries a CVSS v3.1 base score of 9.8 (Critical).
Technical details
- Root cause:
Runner.execute(runner.py, around line 199) receives LLM-generated payloads and forwards them to an execution proxy without validating, sanitizing, or sandboxing the content before running it. - Trigger conditions: An attacker can influence the content an LLM generates (e.g., by manipulating project context or conversation input across multiple turns) so that malicious instructions are embedded into the code/commands Devika subsequently executes automatically.
- Attack vector: Network-based; no authentication and no user interaction are required. A publicly disclosed proof-of-concept demonstrates a two-turn conversation flow — the first turn establishes project context, and the second turn injects instructions that the LLM incorporates into generated code, which is then executed directly by
Runner.execute. - Impact: Full arbitrary code execution in the context of the Devika process, with no confirmation dialogs, whitelisting, or isolation to stop it — resulting in complete loss of confidentiality, integrity, and availability on the host running Devika.
Affected software
- Devika v1.0 (open-source AI agent framework,
stitionai/devika)
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: At the time of disclosure, no official patched release was confirmed by the vendor. Security teams should monitor the project’s GitHub repository for a fixed release and upgrade as soon as one is published.
- If no patch is available:
- Do not expose Devika instances directly to untrusted networks or the public internet; restrict access to trusted, authenticated users only.
- Run Devika in an isolated, sandboxed environment (e.g., containerized with minimal privileges, no access to sensitive hosts/data, restricted filesystem and network egress).
- Disable or restrict automatic execution of LLM-generated commands/code; require explicit human review and approval before any generated command is run.
- Implement command whitelisting and strict input validation around any code/command execution paths.
- Monitor Devika process activity and logs for unexpected file writes, process spawns, or outbound network connections.

