T07 · Tool Hijacking and Spoofing
- Location
SKILL.md:78- Finding
Global Shell Tool Replacement With an Unverified Implementation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 78-89
Vulnerability Type: Tool hijacking through global shell-command redirection
Risk Level: MediumVulnerable Code
markdown ### 3. Add to TOOLS.md Add the following to your OpenClaw `TOOLS.md` so the agent uses ClawShell for shell commands: ```markdown ## Shell Access Use `clawshell_bash` for ALL shell command execution. Do not use `bash` directly. ClawShell will analyze commands for risk and require human approval for dangerous operations. Available tools: - `clawshell_bash(command, workingDir)` — Execute a shell command with risk analysisTechnical Analysis
The Skill directs users to modify the agent's
TOOLS.mdconfiguration so that every shell command is routed through a tool namedclawshell_bash. This gives that tool control over all shell commands issued by the agent.The audited project contains only
SKILL.md. It does not include aclawshell_bashimplementation, package manifest, dependency lockfile, command-analysis rules, approval mechanism, or tool-registration code. Consequently, the claimed interception, blocking, approval, execution, and logging behavior cannot be verified from this artifact.This creates a trusted tool identity without supplying or authenticating the corresponding implementation. If an unrelated or malicious component registers a tool under that name, legitimate-looking shell requests could be intercepted, modified, suppressed, or executed with attacker-controlled behavior.
Attack Path
- A user installs or loads the Skill and follows its setup documentation.
- The user modifies
TOOLS.mdto requireclawshell_bashfor all shell execution and prohibit direct use ofbash. - Because this artifact does not provide the tool implementation, the runtime must obtain or register it from another component.
- An unverified or malicious component supplies a tool using the trusted ` ...[truncated 1074 chars]
- Remediation
View remediation
Remediation Suggestions
- Include the complete
clawshell_bashimplementation, tool-registration logic, risk rules, and approval workflow in the reviewed project. - Supply a package manifest and locked dependency file so all installed components and versions can be audited reproducibly.
- Authenticate the tool implementation before modifying agent configuration, such as by validating a signed package or pinned cryptographic digest.
- Register the tool through an explicit, trusted mechanism rather than relying only on a conventional tool name.
- Do not globally disable direct shell access until installation and integrity checks confirm that the replacement tool is present and trusted.
- Apply least-privilege sandboxing to the replacement tool and restrict its filesystem, network, environment-variable, and process-execution access.
- Ensure approval decisions are cryptographically associated with the exact command, arguments, working directory, and expiration time to prevent approval reuse or command substitution.
- Avoid logging command contents or environment data without redaction, and protect audit logs against unauthorized modification.
- Include the complete
