T09 · Insecure Skill Coding Practices
Error
- Location
SKILL.md:73- Finding
Command Injection Through Unquoted Trace and Project Identifiers
- Content
View full analysis
--trace_id ``` ```bash python3 /Users/jialize/.codewiz/skills/xray-ai-trace-analysis/scripts/query_langfuse_trace.py --trace_id ``` ```bash python3 /Users/jialize/.codewiz/skills/xray-ai-trace-analysis/scripts/query_langfuse_trace.py --trace_id --env sit ``` ### Technical Analysis The skill directs the agent to extract `project_id` and `trace_id` from user-provided URLs or messages and substitute them directly into shell command templates. It does not require validation, shell escaping, quoting, or invocation through an argument-array API. If the agent constructs and executes these commands through a shell, an attacker can supply identifiers containing shell metacharacters such as `;`, `&&`, command substitutions, redirections, or newline characters. The shell may interpret those characters as additional commands rather than as part of a trace identifier. The `--save_project_id` variant also passes attacker-controlled data into a persistent project-ID storage operation. This is not independently proven to enable arbitrary persistent instructions because the referenced script was not included in the audited project, but it increases the importance of strict input validation. The hardcoded absolute path is also environment-specific and places trust in an external local script outside the reviewed skill package. No evidence established that this script is malicious, modified, or downloaded remotely. ### Attack Path 1. An attacker provides a crafted trace URL or identifier, for example an input conceptually equivalent to: ```text legitimate-trace-id; attacker- ...[truncated 1835 chars]- Remediation
View remediation
