T09 · Insecure Skill Coding Practices
- Location
SKILL.md:89- Finding
Ambiguous Shell Commands Can Execute Attacker-Controlled Working-Directory Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:89-92,SKILL.md:189, andSKILL.md:208
Vulnerability Type: Ambiguous local script execution
Risk Level: MediumVulnerable Code
bash # View the canvas overview sh view --board main # Locate my artwork sh locate --board main --mineAdditional affected commands:
bash sh view --board main --region 100,100,200,200bash # Export my artwork backup sh export --mine --out my-artworks.tar.gzTechnical Analysis
The commands pass the generic filenames
view,locate, andexportdirectly to the shell interpreter. These are not canonical paths to trusted scripts, and the audited package does not contain files implementing these commands.When an Agent executes a command such as
sh view --board main,shinterprets the file namedviewfrom the command's working directory. Consequently, command behavior depends on which files happen to exist in that directory rather than on a reviewed implementation distributed with the Skill.This creates a local arbitrary-command execution opportunity when an attacker can place a malicious file named
view,locate, orexportin a directory from which the Agent runs the documented command. The absence of an integrity check, trusted absolute path, or bundled implementation prevents the Agent from establishing that it is executing legitimate canvas functionality.Attack Path
- An attacker gains the ability to add a file to the Agent's project or working directory, such as through a malicious repository, untrusted archive, shared workspace, or previously generated file.
- The attacker creates a shell script named
view,locate, orexport. - A user asks the Agent to perform the corresponding operation documented by the Skill.
- The Agent follows
SKILL.mdand executes a command such assh view --board main. - The shell interprets the attacker-controlled file.
- Commands in that file execute with the operating- ...[truncated 616 chars]
- Remediation
View remediation
Remediation Suggestions
-
Bundle reviewed implementation scripts inside the Skill package rather than referring to generic working-directory filenames.
-
Invoke every script through a trusted canonical path, for example:
bash sh "${baseDir}/scripts/view.sh" --board main sh "${baseDir}/scripts/locate.sh" --board main --mine sh "${baseDir}/scripts/export.sh" --mine --out "my-artworks.tar.gz" -
Validate that the resolved script remains inside the expected Skill directory before execution.
-
Verify packaged script integrity and ownership where the hosting platform supports those controls.
-
Quote all paths and user-supplied arguments.
-
Validate board names, coordinates, region values, and output paths against strict allowlists or schemas.
-
Do not fall back to similarly named files in the current directory or search path when the expected implementation is missing.
-
Fail safely with an explicit error if the trusted script is unavailable.
-
