T09 · Insecure Skill Coding Practices
- Location
SKILL.md:140- Finding
Unrestricted Shell Command Data Source Enables Arbitrary Command Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 140-141
Vulnerability Type: Unrestricted command execution
Risk Level: HighVulnerable Code
yaml - type: command command: "df -h"The same command-source pattern is documented again at
SKILL.md:210-211.Technical Analysis
The Skill declares access to the
exectool and defines a report data-source type whosecommandproperty contains a shell command. The documentation does not impose a command allowlist, structured argument model, shell-metacharacter validation, fixed executable mapping, sandbox, restricted working directory, or user-confirmation requirement.Consequently, an attacker who can supply or modify report configuration could replace the demonstrated
df -hvalue with another command. If the Agent follows the Skill and passes that value to a shell or equivalent execution tool, the value becomes an arbitrary command-execution primitive.This is particularly dangerous when report definitions originate from untrusted project content, generated input, or user-provided configuration. Shell operators, substitutions, redirections, and pipelines could also combine data collection with system modification or disclosure.
Attack Path
- An attacker creates or modifies a report configuration.
- The attacker sets
sources[].typetocommand. - The attacker replaces the documented command with an attacker-controlled shell expression.
- The user or scheduler triggers report generation.
- The Agent interprets the source and invokes its declared
execcapability. - The command executes with the operating-system privileges of the Agent process.
- The attacker may read files, modify project content, invoke network utilities, or execute additional locally available programs.
Impact Assessment
Successful exploitation permits command execution under the Agent's account. The accessible scope may include the cur ...[truncated 447 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove generic command-based data sources unless they are indispensable.
- Replace free-form command strings with a fixed allowlist of collectors, such as a dedicated
disk_usageoperation mapped internally to a known executable. - Pass arguments as structured arrays directly to a process API without invoking a shell.
- Reject shell metacharacters, command substitutions, redirections, pipelines, and multiline values.
- Execute approved collectors in a sandbox with minimal filesystem and network access.
- Use a fixed working directory and a sanitized environment that excludes unrelated credentials.
- Apply execution timeouts, output-size limits, and resource limits.
- Require explicit user confirmation before enabling or changing any command-based source.
- Log the normalized executable and arguments before execution.
