/

CVE-2026-30741

Severity:

CRITICAL RISK

(9.8)

Code Injection / Prompt Injection in OpenClaw Agent Platform

CVE-2026-30741

Analyzed

Vulnerability type

Category:

Code Injection / Prompt Injection

CWE:

CWE-94

Impact:

Remote 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

OpenClaw Agent Platform v2026.2.6 contains a remote code execution flaw where attacker-controlled content in incoming requests can influence the agent's behavior and trigger arbitrary code execution.

When the platform fails to robustly isolate and validate untrusted prompts or instructions from request data, a malicious request can steer downstream tools or execution components into running attacker-chosen code.

Affected context

This vulnerability affects deployments of the OpenClaw Agent Platform v2026.2.6 that process external requests through agent-style workflows capable of invoking tools, scripts, or system commands.

The issue is most relevant where:

  • User or third-party input is converted into prompts or instructions for an agent,
  • The agent is authorized to call code-execution capabilities (e.g., shell commands, scripting runtimes, automation hooks),
  • There is no strong separation between untrusted request content and the agent's privileged execution context.

Exploit preconditions

  • Attack surface: Network-facing APIs, webhooks, or integrations that accept external requests processed by the OpenClaw agent runtime.
  • Required access: Ability to submit or relay crafted requests (e.g., via API client, integrated application, or compromised upstream service).
  • Trigger point: The moment the agent interprets request-side content as instructions and passes them to code-executing tools or back-end components without adequate constraint or filtering.
  • Why exploitation is possible: The platform treats untrusted prompt content as part of its control instructions, allowing attackers to override or augment intended behavior and reach code-execution features exposed to the agent.

Why this happens

At its core, this issue is a code injection problem (CWE-94) manifesting through prompt injection dynamics.

The agent platform allows untrusted request data to participate in the control layer (e.g., "what to run") rather than being confined to the data layer (e.g., "what to operate on").

Because the agent can invoke powerful tools or execution backends, a malicious prompt can smuggle new instructions that direct the system to run arbitrary commands or scripts.

The absence of strong instruction/data separation, policy enforcement on tool usage, and robust prompt input validation enables untrusted content to influence executable code paths.

Potential impact

  • Remote execution of arbitrary commands or scripts under the privileges of the OpenClaw agent runtime
  • Full compromise of the host system or container running the agent platform
  • Unauthorized access to connected services, credentials, or internal APIs reachable by the agent
  • Data exfiltration, modification, or destruction in back-end systems integrated with the agent
  • Abuse of the platform as a pivot point for lateral movement across the network
  • Operational disruption of automated workflows controlled by the agent

General mitigation guidance

Effective mitigation emphasizes strict separation of untrusted content from control instructions and robust governance over code-execution capabilities:

  • Constrain agent capabilities by default, only enabling code-execution tools where strictly necessary and under least-privilege accounts.
  • Introduce explicit allowlists for commands, tools, and code paths the agent may invoke, blocking arbitrary shell or interpreter access.
  • Treat all request-side content as untrusted data: avoid directly embedding it in system-level prompts that can alter tool selection, code paths, or security-critical decisions.
  • Use structured, parameterized interfaces between the agent and execution backends, where the agent selects from predefined operations instead of generating raw executable code.
  • Apply contextual validation and normalization of high-risk fields (e.g., arguments to automation hooks, script bodies, or configuration directives).
  • Implement strong sandboxing and isolation (containers, jails, restricted runtimes) around any components that execute dynamic code.

How teams detect issues like this

Detection typically combines code-level review with behavioral monitoring:

  • Static analysis & code review:
  • Look for flows where request parameters or prompt content can influence which commands, scripts, or tools the agent invokes.
  • Flag patterns where natural-language instructions are directly translated into executable shell, SQL, or scripting code.
  • Identify generic "exec", "eval", or interpreter bindings exposed to agent instructions without strict whitelisting or argument validation.
  • Runtime monitoring:
  • Log all high-privilege tool invocations and correlate them with request identifiers and originating tenants or users.
  • Alert on anomalous command patterns, unexpected interpreters, or outbound connections initiated from the agent runtime.
  • Policy enforcement:
  • Use automated review tools or CI/CD checks to enforce policies such as "no direct execution APIs reachable from untrusted prompt inputs".
  • Periodically test agent endpoints with synthetic prompt injection scenarios to validate defensive controls.

Sources

SourceLink
github.comgithub.com/Named1ess/CVE-2026-30741
github.comgithub.com/OpenClaw/OpenClaw
bilibili.combilibili.com/video/BV1LoFazeEBM

Frequently asked

questions

Yes. An attacker who can send crafted requests to an affected OpenClaw endpoint can potentially trigger remote code execution, assuming those requests are processed by an agent with access to code-execution tools.

The attacker typically needs the ability to submit or relay requests to the agent platform.

No direct shell or system access is required; the exploit rides on the agent's ability to interpret and act on malicious prompt instructions.

The most robust pattern is to remove or tightly confine dynamic code execution from agent workflows, enforce strict allowlists on the operations the agent can perform, and ensure untrusted content cannot influence which code is run or how tools are invoked.

Design agent architectures with clear boundaries between data and control, minimize the agent's authority to execute arbitrary code, and enforce secure-by-default configurations.

Complement this with systematic prompt-hardening, policy-driven tool governance, and automated checks that detect when untrusted inputs can reach code-execution interfaces.

Find out what's already
exploitable in your codebase.