Summary
FoundDream miniclawd contains an OS command injection vulnerability in the ExecTool.execute function, where externally influenced input is passed into system-level command execution.
When an attacker can control or tamper with the arguments passed to this function over a remote interface, they may execute arbitrary commands on the underlying operating system.
Affected context
The vulnerability appears in the /src/tools/exec.ts module, specifically in ExecTool.execute, where shell or process commands are constructed and invoked.
It becomes relevant in deployments where:
- ExecTool.execute is reachable via network-exposed APIs or other remotely invocable paths
- User-provided or untrusted data influences command strings or arguments
- There is no strict validation, sanitization, or whitelisting of allowed commands or parameters
Because the project does not use versioning, any instance up to commit 2d65665046e2222eeea76cafc8570ed546a8c125 may be affected unless locally patched.
Exploit preconditions
- Attack surface: Network-accessible functionality that indirectly or directly calls ExecTool.execute
- Required access: Ability to trigger the vulnerable code path with attacker-controlled input (e.g., API calls, web requests, task configuration)
- Trigger point: Execution of OS-level commands using input that is embedded into a shell command or passed unsafely to a process launcher
- Why exploitation is possible: The implementation likely concatenates or interpolates input into command strings, or passes it to a shell, without proper neutralization or strict whitelisting, allowing injection of additional commands or options
Why this happens
This issue stems from improper neutralization of special elements used in OS commands, aligning with CWE-78 (OS Command Injection) and related patterns in CWE-77 (Command Injection).
At a high level, the code path in ExecTool.execute treats user-controlled or untrusted input as part of a command line, either by string concatenation, template expansion, or passing the data directly to a shell interpreter.
Without constraining what can be executed—such as using fixed command paths, argument whitelisting, or non-shell process spawning—an attacker can craft input that alters the intended command, injects additional commands, or changes arguments in a way that executes arbitrary OS-level actions.
Potential impact
- Remote execution of arbitrary commands under the privileges of the miniclawd process
- Unauthorized access to files, including reading or modifying application data
- Lateral movement within the host environment or connected systems, depending on configuration
- Service disruption through process termination, resource exhaustion, or destructive commands
- Potential escalation of impact if combined with misconfigurations, weak credentials, or excessive process privileges
General mitigation guidance
Effective mitigation generally focuses on removing or tightly constraining the use of shell interpreters for dynamic input:
- Prefer APIs that launch processes without a shell and pass arguments as structured arrays rather than concatenated strings
- Enforce strict allowlists for executable commands and permissible arguments, rejecting anything unexpected
- Normalize and validate all external input before it can influence command execution, reducing reliance on blacklisting patterns
- Isolate components that must execute system commands using least privilege, containerization, or sandboxing to limit blast radius
- Centralize command execution utilities so security checks and safe patterns are consistently applied
How teams detect issues like this
Detection can combine code-level and operational techniques:
- Static analysis rules to flag patterns like shell invocation functions with interpolated or concatenated variables (e.g., exec-style APIs, shell: true options)
- Code review checklists that explicitly ask reviewers to identify any place where external input reaches OS command execution
- Logging and monitoring of executed commands, focusing on anomalous arguments, unexpected utilities, or user-controlled parameters
- Automated policy enforcement in CI that blocks merges when unsafe command-construction patterns are detected in TypeScript/JavaScript tooling code
- Periodic security assessments or red-team tests that attempt to influence command-execution utilities via exposed APIs

