T09 · Insecure Skill Coding Practices
- Location
scripts/ssh_file_manager.py:14- Finding
Local SSH Option Injection Through the Host Argument
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real remote file manager, but its broad SSH file-changing powers and weak input safeguards make it require careful review before use.
Install only if you trust the operator and the Tailnet environment, and expect the skill to use your existing SSH access to read, overwrite, chmod, copy, move, and recursively delete remote files. Avoid using it with untrusted hostnames, paths, modes, or prompts until host/path validation, destructive-operation guardrails, and safer remote command construction are added.
scripts/ssh_file_manager.py:14Local SSH Option Injection Through the Host Argument
scripts/ssh_file_manager.py:67Remote Python Code Injection Through List and Stat Paths
scripts/ssh_file_manager.py:168Remote Shell Command Injection Through Chmod Mode
scripts/ssh_file_manager.py:14Automatic Trust of Unknown SSH Host Keys
The documented behavior promises broad remote file-management functionality, while the analysis indicates the actual implementation may only perform SSH reachability checks and lacks the claimed controls and operations. This mismatch is dangerous because operators may trust the skill to safely manage remote files or enforce safeguards when it does not, leading to misuse, unsafe fallbacks, or invocation of unintended shell behavior.
The delete action issues rm -rf against an arbitrary remote path with no confirmation prompt, no dry-run mode, no path restrictions, and no safeguards against dangerous targets such as / or critical system directories. In a remote file-management skill, this materially increases the chance of catastrophic accidental deletion or misuse through prompt manipulation or incorrect user input.
The skill exposes shell-driven remote file management behavior through documented use of ssh/scp/sftp helper scripts, but it declares no explicit tool scope or permission boundaries. That makes the effective capability broader and less governable, increasing the risk of unauthorized file access, remote modification, or command execution through an over-privileged skill runtime.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
command,
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, input=stdin)
return result.returncode, result.stdout, result.stderr
except subprocess.TimeoutExpired:
return -1, "", "SSH connection timed out"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
dst,
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
return result.returncode, result.stdout, result.stderr
except subprocess.TimeoutExpired:
return -1, "", "SCP connection timed out"
The write operation unconditionally overwrites or creates a remote file via SCP without warning, backup, existence checks, or an explicit overwrite flag. In this skill's context, where the agent manages files on remote hosts, silent overwrites can destroy important data or alter configuration and operational files with little friction.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"echo tailnet-ssh-ok",
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
if result.returncode == 0 and "tailnet-ssh-ok" in result.stdout:
print(json.dumps({
"success": True,