T09 · Insecure Skill Coding Practices
- Location
SKILL.md:15- Finding
Command Injection Through Unvalidated Download Parameters
- Content
View full analysis
" --cookies "" -D "<目标目录>" "https://www.instagram.com/<用户名>/" ``` ### Technical Analysis The Instagram username, destination directory, cookie-file path, and proxy address all originate from user input. The Skill does not define strict validation, character allowlists, or shell-safe argument handling before inserting these values into a command template. Surrounding a value with double quotes is not a sufficient shell-injection defense. An attacker can supply a quote character to terminate the intended argument and then introduce command separators, command substitutions, newlines, or other syntax recognized by the relevant shell. Shell behavior varies by platform, but both Unix-like shells and Windows command interpreters have metacharacters that can alter the intended command structure. For example, if a Unix-like shell is used, a malicious username shaped like the following can terminate the URL argument and append another command: ```text victim"; touch /tmp/gallery-dl-injection; # ``` Textual substitution would produce a command structurally equivalent to: ```bash gallery-dl --proxy "" --cookies "" -D "" "https://www.instagram.com/victim"; touch /tmp/gallery-dl-injection; #/" ``` The `touch` operation is a non-destructive proof of concept. An attacker could substitute any command available to the Agent's operating-system account. The proxy and path parameters present similar risk ...[truncated 1671 chars]- Remediation
View remediation
