T09 · Insecure Skill Coding Practices
- Location
scripts/mediaproc.sh:13- Finding
Destructive remote file operations lack an enforced confirmation gate
- Content
View full analysis
Vulnerability Details
File Location:
scripts/mediaproc.sh:13-16; related confirmation requirement atSKILL.md:142-145
Vulnerability Type: Missing authorization enforcement for destructive operations
Risk Level: MediumVulnerable code:
bash exec ssh -p "$MEDIAPROC_PORT" \ -o StrictHostKeyChecking=accept-new \ -o LogLevel=ERROR \ "mediaproc@$MEDIAPROC_HOST" "$*"Documented security requirement:
markdown **Destructive.** `remove-file`, `remove-dir`, and `remove-dir-recursive` permanently delete data in the remote work directory — there is no trash/undo. `remove-dir-recursive` deletes an entire subtree in one call and is especially dangerous. Only run these after explicit user confirmation of the exact path.Technical Analysis
The wrapper forwards the entire command supplied by the calling agent to the configured SSH service without distinguishing destructive commands from ordinary media-processing or read-only operations. In particular, it does not require a confirmation option, confirmation token, interactive prompt, or dry-run before forwarding
remove-file,remove-dir, orremove-dir-recursive.Although
SKILL.mdinstructs the agent to obtain explicit confirmation for the exact path, this requirement is only documentary. The executable entrypoint does not enforce it and can be invoked directly by an agent or another integration without evidence that the user approved the deletion.The dangerous operation crosses the authorization boundary between an agent-generated command and the user’s authenticated remote media workspace. The SSH key grants the wrapper authority to delete data, while the caller is trusted to enforce confirmation entirely outside the script.
Attack Path
- The Skill runs with
MEDIAPROC_HOSTandMEDIAPROC_PORTconfigured and has access to the user’s SSH identity. - A calling agent or integration constructs a destructive ...[truncated 1244 chars]
- The Skill runs with
- Remediation
View remediation
Remediation Suggestions
- Parse the requested operation before opening the SSH connection and explicitly identify destructive commands.
- Require a dedicated confirmation argument or short-lived confirmation token for
remove-file,remove-dir, andremove-dir-recursive. - Bind confirmation to the exact command and normalized target path so approval for one location cannot authorize another.
- Reject destructive commands when confirmation is absent, rather than relying solely on agent instructions.
- Prefer a separate entrypoint for destructive operations to reduce accidental invocation.
- Add a dry-run or target-listing mode, especially for recursive deletion.
- Preserve the server-side work-directory confinement and command allowlist as defense-in-depth controls.
