T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Shell Command Injection Through Unsafely Interpolated User Input
- Content
View full analysis
call `POST /api/jd/analyze` - Endpoint: `POST http://127.0.0.1:8010/api/jd/analyze` - Header: `Content-Type: application/json` - Body: `{"jd_text":""}` - Example: - `curl -sS -X POST "http://127.0.0.1:8010/api/jd/analyze" -H "Content-Type: application/json" -d '{"jd_text":""}'` - If user asks to search/scanning BOSS -> call `POST /api/boss/scan` - Endpoint: `POST http://127.0.0.1:8010/api/boss/scan` - Header: `Content-Type: application/json` - Body: `{"keyword":"","max_items":10,"max_pages":2}` - Example: - `curl -sS -X POST "http://127.0.0.1:8010/api/boss/scan" -H "Content-Type: application/json" -d '{"keyword":"","max_items":10,"max_pages":2}'` ``` ### Technical Analysis The skill instructs the agent to invoke `curl` through the `exec` tool and places untrusted JD text or search keywords directly inside a single-quoted shell argument. No safe JSON serialization, shell escaping, or argument-array invocation is specified. A single quote in attacker-controlled input can terminate the intended JSON argument. The attacker can then introduce shell metacharacters such as semicolons and a comment marker, causing the shell to interpret the remaining input as additional commands rather than request data. This affects both documented API operations: - `POST /api/jd/analyze` through the `jd_text` value. - `POST /api/boss/scan` through the `keyword` value. The vulnerability exists before the request reaches the localhost API; therefore, server-side JSON validation does not prevent exploitation. ### Attack Path 1. An attacker asks the skill to analyze a JD or search for a keyword. 2. The supplied value contains a single quote followed by shell ...[truncated 1530 chars]- Remediation
View remediation
