CVE-2026-55249: Command Injection in @rtk-ai/rtk-rewrite 1.0.0
@rtk-ai/rtk-rewrite is a plugin that translates shell commands into RTK-equivalent operations. Version 1.0.0 contains a command injection flaw: when the plugin processes input for shell execution, it fails to properly escape shell metacharacters like $() and backticks. An attacker who can control command input—through a prompt injection, tool-call manipulation, or similar avenue—can inject arbitrary shell commands that execute with the privileges of the plugin or gateway process. The vulnerability requires an authenticated user or external input route, but the technical bar for exploitation is low once that access exists.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 6.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N
- Weaknesses (CWE)
- CWE-78
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-23 / 2026-07-01
NVD description (verbatim)
@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.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The @rtk-ai/rtk-rewrite OpenClaw plugin constructs shell commands by embedding user input into a template string passed to execSync(). Although the code uses JSON.stringify() to wrap values in double quotes and escape internal quotes and backslashes, this escaping is insufficient. Shell metacharacters $() and backticks are left untouched and are expanded by /bin/sh -c before the rtk command is parsed. This allows command substitution within what the developer likely believed was a quoted, literal string. An attacker controlling the exec tool's command parameter—whether through LLM prompt injection, API gateway input, or tool-chain manipulation—can inject a payload like `command; malicious_command` or `$(malicious_command)` to achieve arbitrary code execution.
Business impact
Any system running the @rtk-ai/rtk-rewrite plugin (version 1.0.0) with untrusted or semi-trusted input sources is at risk of unauthorized command execution. In AI-driven workflows (LLM agents, tool gateways, orchestration platforms), this creates a path from external prompts or API calls to OS-level compromise. A successful attack could lead to data exfiltration, lateral movement, container escape, supply chain poisoning, or denial of service—depending on the attacker's objectives and the privilege level of the compromised process.
Affected systems
@rtk-ai/rtk-rewrite version 1.0.0 is the confirmed affected release. Organizations using this plugin should inventory their deployments, particularly those exposed to untrusted input (e.g., LLM-driven applications, user-submitted prompts, or public API gateways). Verify your installed version and whether your OpenClaw or tool-calling infrastructure can pass attacker-controlled input to the exec function.
Exploitability
Exploitation requires the ability to influence the exec tool's command parameter. In many AI-agent and gateway deployments, this is achievable through prompt injection or API input without authentication. Once attacker-controlled input reaches the plugin, the injection is trivial—no complex parsing or race conditions required. CVSS 6.3 (Medium) reflects the requirement for user interaction or authenticated access in some contexts; however, in open-facing LLM systems or shared tool gateways, the barrier to entry is low. This is not a network-only unauthenticated remote code execution from a standing start, but it is straightforward to exploit in realistic deployment scenarios.
Remediation
Upgrade @rtk-ai/rtk-rewrite to a patched version that properly escapes shell metacharacters. Until a patch is available, disable or restrict the exec tool to trusted internal operations only, and implement strict input validation and sandboxing for any user-controllable data that could reach the command parameter. If the plugin is part of an LLM agent or gateway, apply prompt guards and input filtering to prevent injection payloads from reaching the exec function. Consider running the plugin in a restricted container or sandbox with minimal OS capabilities.
Patch guidance
Check the @rtk-ai/rtk-rewrite project repository or vendor advisory for patched versions. The fix should replace JSON.stringify() escaping with proper shell-aware escaping (e.g., using libraries like `shell-escape` or `shlex.quote` equivalents) to neutralize $(), backticks, and other shell metacharacters. Verify the patch version in the vendor's release notes before deploying to production. After patching, test command-execution workflows with sample payloads containing shell metacharacters to confirm the fix is effective.
Detection guidance
Look for instances of @rtk-ai/rtk-rewrite 1.0.0 in package.json, lock files, and container images. Monitor execSync() or subprocess execution logs for suspicious command patterns, especially those containing $() or backticks in arguments. Inspect LLM prompt logs and API gateway access logs for injection-like payloads (e.g., commands embedded in user input). If your plugin is exposed via tool-calling interfaces, correlate exec tool invocations with external or untrusted input sources. Check process execution telemetry for unexpected child processes spawned from the plugin's context.
Why prioritize this
Although rated MEDIUM, this vulnerability warrants prompt attention in AI-heavy deployments where LLM agents or public gateways can influence exec inputs. The technical simplicity of exploitation combined with the high business impact of OS command execution justifies treating this as a near-critical issue if your infrastructure is exposed. Organizations with closed, trust-boundary-respecting tool access can defer patching slightly longer, but public-facing or prompt-injectable scenarios should be patched immediately.
Risk score, explained
CVSS 6.3 reflects (i) network-accessible exploitation vector, (ii) low attack complexity—no special conditions or tools needed—(iii) requirement for low privilege (authenticated user or trusted input channel) in the CVSS model, (iv) no scope change, and (v) high confidentiality impact (arbitrary command execution can read sensitive data) but lower impact on integrity and availability in this particular vector. In real-world AI and gateway contexts, you should mentally elevate this to 8+, as the 'low privilege' requirement is often moot when the tool is exposed to untrusted LLM prompts or API calls.
Frequently asked questions
Can this vulnerability be exploited without any authentication or user interaction?
In a pure CVSS sense, the vector requires low privilege and user interaction. In practice, if your @rtk-ai/rtk-rewrite plugin is accessible via an LLM agent, chatbot, or public API gateway, an attacker can influence the exec command through prompt injection or API input without traditional authentication. The difference between CVSS and real-world risk is significant here.
What versions of @rtk-ai/rtk-rewrite are affected?
Version 1.0.0 is confirmed vulnerable. Check your package manager and deployment manifests for this specific version. If a patched version has been released, the vendor advisory will specify the fixed version number; upgrade to or above that release.
Can I safely use the exec tool if I validate the input myself?
Input validation helps but is error-prone. The core issue is that JSON.stringify() alone does not provide shell-safe escaping. Even with your own validation, using proper escaping libraries (like shell-escape) in the plugin itself is the correct fix. Until the vendor patches the plugin, restrict exec to completely trusted use cases and avoid any path where user input could influence the command.
Does this affect only OpenClaw or other frameworks too?
The vulnerability is in the @rtk-ai/rtk-rewrite plugin's interaction with OpenClaw's exec tool. If rtk-rewrite is integrated into other LLM or AI frameworks that provide similar command-execution primitives, the same flaw would apply. Check your entire AI toolchain for use of rtk-rewrite.
This analysis is provided for informational purposes and based on published CVE details as of the date of this report. SEC.co does not guarantee the accuracy, completeness, or timeliness of any remediation advice. Organizations should verify patch availability and applicability with the vendor (@rtk-ai) and conduct independent testing before deploying fixes to production. Exploit code and detailed weaponization guidance are not provided. Follow responsible disclosure practices and consult your security team before applying mitigations. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-10279MEDIUMOS Command Injection in wezterm-mcp 0.1.0
- CVE-2026-10544MEDIUMDevolutions Server PAM Command Injection Vulnerability
- CVE-2026-10805MEDIUMNetworkManager Local Privilege Escalation via Malformed MUD URL
- CVE-2026-11341MEDIUMD-Link DWR-M920 Command Injection Vulnerability – Patch & Detection Guide
- CVE-2026-11408MEDIUMOS Command Injection in vertex-app Log Viewer Endpoint
- CVE-2026-12814MEDIUMComfast CF-WR631AX V3 Command Injection Vulnerability
- CVE-2026-12815MEDIUMOS Command Injection in Coolify 4.0.0 Image Name Handler
- CVE-2026-25620MEDIUMArista NGFW Command Injection in Captive Portal (v17.4.0)