T09 · Insecure Skill Coding Practices
- Location
SKILL.md:157- Finding
Shell Command Injection Through Unquoted User-Controlled File Paths
- Content
View full analysis
` to read a file. 4. Modify the content if needed. 5. Run `northbase put ` to update or create the file. ``` ### Technical Analysis The skill directs the agent to substitute a user-provided file path directly into a shell command. It does not require shell-safe quoting, path validation, an end-of-options delimiter, or execution through a shell-free argument array. Because users can explicitly reference filenames when invoking the skill, the `` value may be attacker-controlled. If the agent constructs and executes the documented command through a shell, metacharacters such as semicolons, command substitutions, redirection operators, or pipelines may be interpreted as shell syntax rather than as part of the filename. Paths beginning with `-` may also be parsed as command-line options by the Northbase CLI, potentially altering its behavior even when shell metacharacters are unavailable. ### Attack Path 1. An attacker asks the agent to read or update a purported note with a crafted path, such as: ```text notes.md; id > /tmp/northbase-proof ``` 2. The agent follows the documented template and constructs: ```sh northbase get notes.md; id > /tmp/northbase-proof ``` 3. If executed through a command shell, the shell treats the semicolon as a command separator. 4. The Northbase command runs first, followed by the injected operating-system command. 5. The injected command executes with the same operating-system identity, filesystem permissions, environment variables, and accessible credentials as the agent process. The same issue applies to `northbase put `. In that case, attacker-controlled content may also be piped through standard input while the crafted path injects an additional command. ### ...[truncated 774 chars]- Remediation
View remediation
