T09 · Insecure Skill Coding Practices
- Location
SKILL.md:121- Finding
Shell Command Injection Through Unquoted File Paths and Lock Arguments
- Content
View full analysis
-z LE -d -z # Safe folder encrypt / decrypt (source folder preserved) LE -e -z -n LE -d -z -n # Destructive — only after explicit user confirmation LE -e -j ``` The workflow subsequently instructs the agent to construct and execute these commands through Bash: ```text 2. **Resolve the binary** via `$LE_BIN`, `command -v LE`, or ask the user. 3. **Gather lock inputs:** Which locks to apply and their values. 4. **Pick safe defaults:** `-z` for files; `-z -n` for folders. Do not add `-c` or `-j` unless the user explicitly confirmed source deletion. 5. **Build the command** with the appropriate flags. 6. **Execute via Bash** and return the result. ``` ### Technical Analysis The command templates place user-controlled file paths, directory paths, output names, password-file paths, and lock values directly into shell command positions. The skill does not require these values to be passed through an argument array or apply a mandatory shell-escaping procedure. If an implementation constructs the documented command as a string and submits it to Bash, shell metacharacters in an argument can alter command structure. Relevant metacharacters include semicolons, command substitutions, pipes, redirections, and logical operators. The plaintext sanitization rules elsewhere in the file do not protect file and folder mode, information queries, password-file paths, MFA values, output paths, or other lock arguments. ### Attack Path 1. An attacker supplies a crafted file path, folder path, output name, or lock value containing shell syntax. 2. The agent substitut ...[truncated 1051 chars]- Remediation
View remediation
