T09 · Insecure Skill Coding Practices
- Location
workflows/white-space.md:65- Finding
Command Injection Through Unsafe Shell Interpolation
- Content
View full analysis
$WORKDIR/p1_abc.json & # Omit A (B+C) curl -s -H "API-Key: $KEY" "$API/api/v1/search/products/search?description={feature_B}%20{feature_C}&limit=50&is_headquarters=true" > $WORKDIR/p1_bc.json & # Omit B (A+C) curl -s -H "API-Key: $KEY" "$API/api/v1/search/products/search?description={feature_A}%20{feature_C}&limit=50&is_headquarters=true" > $WORKDIR/p1_ac.json & # Omit C (A+B) curl -s -H "API-Key: $KEY" "$API/api/v1/search/products/search?description={feature_A}%20{feature_B}&limit=50&is_headquarters=true" > $WORKDIR/p1_ab.json & # Swap: replace C with new feature D curl -s -H "API-Key: $KEY" "$API/api/v1/search/products/search?description={feature_A}%20{feature_B}%20{feature_D}&limit=50&is_headquarters=true" > $WORKDIR/p1_abd.json & wait ``` ### Technical Analysis The workflows direct an agent to substitute domain and feature values directly into shell command templates. The initial domain originates from the user, while the feature-swap workflow explicitly permits the user to provide `feature_D`. No mandatory domain validation or URL-encoding operation is specified before generating the shell source. Double quotes do not prevent shell command substitution. If an agent reproduces an attacker-controlled value ...[truncated 1735 chars]- Remediation
View remediation
"$WORKDIR/p1_abc.json" ``` 8. Add adversarial tests covering command substitutions, backticks, quotes, newlines, ampersands, semicolons, Unicode separators, and percent-encoded control characters. ]]>
