T09 · Insecure Skill Coding Practices
- Location
SKILL.md:49- Finding
Potential Shell Command Injection Through Unquoted User-Controlled Arguments
- Content
View full analysis
--source rank --data '{"": , ...}'`, then `ledger.py diff --source rank` for the change since the last check and `ledger.py trend --source rank --field ""` for the series. ``` ### Technical Analysis The command template inserts the user-supplied `` value into a shell command without quoting or validation: ```sh python3 "${CLAUDE_PLUGIN_ROOT}/scripts/connectors/ledger.py" record --source rank ``` If an agent or host constructs and executes this command as a shell string, shell metacharacters in the domain can terminate or extend the intended command. The JSON supplied to `--data` may present a similar risk if user-controlled keywords are interpolated into the single-quoted payload without robust JSON and shell escaping. The later `diff` and `trend` examples also use an unquoted domain placeholder. The trend command quotes ``, but ordinary double quoting does not make shell-string construction safe if interpolation or evaluation occurs incorrectly. The package declares only `WebFetch` as an allowed tool and does not bundle `ledger.py`, so exploitation requires a compatible host to expose shell execution and follow this documented command despite that declared restriction. This limits direct exploitability but does not remove the unsafe command-construction guidance. ### Attack Path 1. An attacker supplies a crafted domain or keyword as rank-tracking input. 2. The agent substitutes that value into the documented ledger ...[truncated 1451 chars]- Remediation
View remediation
