T09 · Insecure Skill Coding Practices
- Location
SKILL.md:29- Finding
Command Injection Through Unsanitized Agent Name
- Content
View full analysis
``` ```bash # Add the Feishu account to the configuration openclaw config set "channels.feishu.accounts..appId" "" openclaw config set "channels.feishu.accounts..appSecret" "" # Bind the Agent to the Feishu account openclaw agents bind --agent --bind feishu: ``` If the executing agent performs textual substitution through a shell, an attacker can provide an Agent ID containing shell metacharacters, command substitutions, whitespace, or quote characters. For example, a value containing `;`, `&&`, `$()`, or a double quote could escape the intended argument or quoted configuration key and introduce an additional command. Quoting alone would not be sufficient if commands are constructed as shell strings. The value must be validated against the actual Agent ID grammar and passed as a discrete process argument without shell interpretation. ### Attack Path 1. An attacker triggers the skill by supplying a Feishu App ID and App Secret. 2. When asked for the target Agent ID, the attacker provides a malicious value containing shell syntax. 3. The skill substitutes that value into `openclaw agents add`, `openclaw config set`, or `openclaw agents bind`. 4. The command is executed through a shell without strict validation or argument-safe invocation. 5. The injected shell expression executes with the operat ...[truncated 577 chars]- Remediation
View remediation
