T09 · Insecure Skill Coding Practices
- Location
SKILL.md:61- Finding
Destructive Commands Consume Unvalidated Interactive Selections
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:61-63,SKILL.md:184-186, andSKILL.md:199-201
Vulnerability Type: Unsafe argument handling in destructive command pipelines
Risk Level: MediumVulnerable Code
bash # Delete selected files fzf -m | xargs rmbash # Remove selected images docker images | fzf -m | awk '{print $3}' | xargs docker rmibash # Delete pods kubectl get pods | fzf -m | awk '{print $1}' | xargs kubectl delete podTechnical Analysis
These examples pass interactively selected text directly to destructive commands without robust argument boundaries, target validation, or confirmation.
The file deletion pipeline uses newline-delimited output and allows
xargsto reinterpret whitespace, quotes, backslashes, and option-like values. Consequently, a selected filename may be divided into multiple arguments or interpreted as anrmoption.The Docker and Kubernetes examples parse human-readable tables with
awk. Human-oriented output is not a stable machine-readable interface and includes a header row. A user can select the header or an unintended resource. The Kubernetes command also does not present or validate the active context and namespace before deletion.Attack Path
- An attacker or untrusted repository introduces a filename containing whitespace, newlines, quotes, or an option-like prefix.
- The user runs the documented multi-selection deletion workflow.
- The crafted filename is selected in
fzf. xargsreparses the selection rather than preserving it as one filename.rmreceives unintended operands or options and deletes files other than the target the user expected.
For Docker or Kubernetes, an operator may select an unintended row or run the command under an unexpected context or namespace. The parsed value is then passed directly to
docker rmiorkubectl delete podwithout an additional verification step. ...[truncated 465 chars]- Remediation
View remediation
Remediation Suggestions
- Preserve filename boundaries with NUL-delimited processing, such as
find ... -print0,fzf --read0 --print0, andxargs -0 -r. - Place
--before file operands so option-like filenames cannot be interpreted as command options. - Add a confirmation stage that displays the exact resolved targets before deletion.
- Use machine-readable Docker output, for example
docker images --format, and explicitly exclude headers. - Use structured Kubernetes output such as
kubectl get pods -o name. - Display and validate the Kubernetes context and namespace before executing deletion.
- Prefer non-destructive previews or dry-run operations where available.
- Preserve filename boundaries with NUL-delimited processing, such as
