/

CVE-2026-51871

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Devika Runner Execution Path

CVE-2026-51871

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical code injection vulnerability in Devika's Runner.execute function directly executes content generated by a large language model (LLM).

An attacker who can influence the content reaching this execution path may cause arbitrary code to run with the privileges of the Devika process.

Affected context

The vulnerability occurs in Devika v1.0 when the runner processes LLM-generated content through the Runner.execute function. It becomes risky when model output can be influenced by untrusted prompts, retrieved content, external inputs, or other data that reaches the execution path without being treated as untrusted.

Exploit preconditions

  • Attack surface: Devika's LLM-driven runner and execution workflow
  • Required access: An ability to influence prompts, task inputs, retrieved content, or other data incorporated into LLM output
  • Trigger point: Processing of LLM-generated content by Runner.execute
  • Why exploitation is possible: Generated content is executed directly rather than being treated as inert data and constrained by an allowlisted execution model

Why this happens

The underlying issue is the direct execution of LLM-generated content as program logic. This insecure pattern fails to maintain a trust boundary between generated text and executable code, allowing attacker-influenced output to reach an execution mechanism without sufficient validation, interpretation, or restriction.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), because externally influenced content can alter the code executed by the application.

Potential impact

  • An attacker may execute arbitrary code in the Devika process context
  • Sensitive files, credentials, or environment variables could be accessed
  • The application or host environment could be compromised
  • Data could be modified, deleted, or exfiltrated
  • Compromised workloads could be used for lateral movement or further abuse

General mitigation guidance

Mitigation generally focuses on preventing generated content from becoming unrestricted executable code.

Common defensive patterns include:

  • Treating all LLM output as untrusted data by default
  • Replacing general-purpose execution with narrowly scoped, allowlisted operations
  • Using structured outputs and strict schemas instead of free-form code
  • Applying validation, canonicalization, and policy checks before any execution decision
  • Running unavoidable dynamic tasks in isolated, least-privileged sandboxes
  • Restricting filesystem, network, credential, and process access for the runner
  • Separating model interaction from privileged application operations

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving exec, eval, shell invocation, dynamic imports, or equivalent execution APIs
  • Code paths that pass LLM output directly into interpreters, subprocesses, templates, or scripting engines
  • Code review signals showing missing allowlists, schemas, approval gates, or sandbox boundaries
  • Runtime monitoring for unexpected child processes, command execution, network connections, or access to sensitive paths
  • Policy enforcement requiring generated actions to use approved tools and structured interfaces

Automated code-review and application-security tools may help identify direct flows from model output to execution sinks.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/3067a5bd69dcd35ffc98dc41ca611242
github.comgithub.com/stitionai/devika/issues/714

Frequently asked

questions

Potentially. Exploitability depends on whether an attacker can influence prompts, task data, retrieved documents, or another input that affects LLM-generated content reaching the runner.

Not necessarily. Authentication requirements depend on how Devika is exposed and which users or integrations can submit tasks or influence model context.

Avoid executing free-form LLM output. Prefer structured, allowlisted actions and isolate any remaining dynamic processing with strict resource and privilege controls.

Establish a firm trust boundary around model output, validate generated actions against schemas and policies, monitor execution behavior, and test data-to-execution paths during security reviews.

Find out what's already
exploitable in your codebase.