T09 · Insecure Skill Coding Practices
- Location
SKILL.md:246- Finding
Host-Key Verification Disabled in SSH Configuration Example
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent SSH reference skill, but some copyable examples could weaken SSH host verification or mislead users about connection encryption.
Install only if you want a general SSH command reference and are comfortable vetting commands before use. Treat StrictHostKeyChecking=no, ssh-keyscan >> known_hosts, rsync --delete, agent forwarding, remote forwarding, background tunnels, and sudo-over-SSH as sensitive operations that should be adjusted to your environment and run only after you understand the consequences.
SKILL.md:246Host-Key Verification Disabled in SSH Configuration Example
SKILL.md:377Verified SSH Host Key Is Discarded and Re-Scanned Before Trust
SKILL.md:159Misleading Encryption Guidance for SSH SOCKS and Port Forwarding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -v user@hostname
# Connect with specific key
ssh -i ~/.ssh/id_rsa user@hostname
# Connect and run command
ssh user@hostname 'ls -la'
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh-copy-id -i ~/.ssh/id_rsa.pub user@hostname
# Manual key copy
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> ~/.ssh/authorized_keys'
# Check key fingerprint
ssh-keygen -lf ~/.ssh/id_rsa.pub
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh-copy-id -i ~/.ssh/id_rsa.pub user@hostname
# Manual key copy
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> ~/.ssh/authorized_keys'
# Check key fingerprint
ssh-keygen -lf ~/.ssh/id_rsa.pub
The skill provides a live rsync --delete command that will remove destination files not present in the source. Although it includes warnings and recommends a prior dry run, users may still copy-paste it and cause unintended destructive data loss, especially in automation or when source/destination paths are mistaken.
# Review the output, then execute the real command
# Sync with delete (mirror) — only after dry-run confirms expected changes
rsync -avz --delete /local/dir/ user@hostname:/remote/dir/
# (⚠️ DELETION WARNING: This removes files from the destination that aren't in the source.
# Double-check --dry-run output before running. Consider using --ignore-errors for large transfers.)
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
**Why:** Issue #6 — No warning about plaintext key storage risk.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
rsync -avz --progress /local/dir/ user@hostname:/remote/dir/
# Sync with delete (mirror)
rsync -avz --delete /local/dir/ user@hostname:/remote/dir/
# Exclude patterns
rsync -avz --exclude '*.log' --exclude 'node_modules/' \
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
rsync -avz --progress /local/dir/ user@hostname:/remote/dir/
# Sync with delete (mirror)
rsync -avz --delete /local/dir/ user@hostname:/remote/dir/
# Exclude patterns
rsync -avz --exclude '*.log' --exclude 'node_modules/' \
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
rsync -avz --progress /local/dir/ user@hostname:/remote/dir/
# Sync with delete (mirror)
rsync -avz --delete /local/dir/ user@hostname:/remote/dir/
# Exclude patterns
rsync -avz --exclude '*.log' --exclude 'node_modules/' \
Even with warnings, the document still includes a live rsync --delete command that readers may copy-paste into production. Because --delete irreversibly removes destination files missing from the source, path mistakes, trailing-slash confusion, or reversed source/destination can cause destructive data loss.
# Review the output, then execute the real command
# Sync with delete (mirror) — only after dry-run confirms expected changes
rsync -avz --delete /local/dir/ user@hostname:/remote/dir/
# (⚠️ DELETION WARNING: This removes files from the destination that aren't in the source.
# Double-check --dry-run output before running. Consider using --ignore-errors for large transfers.)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh-keyscan -t ed25519 hostname
# (⚠️ Run ssh-keyscan independently first, compare the output against a trusted key
# obtained via another channel (e.g., admin console, PGP-signed key page). Only then append:
ssh-keyscan -t ed25519 hostname >> ~/.ssh/known_hosts
# If the scanned key doesn't match the trusted key, DO NOT append it.)
# Use specific cipher
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh-keyscan -t ed25519 hostname
# (⚠️ Run ssh-keyscan independently first, compare the output against a trusted key
# obtained via another channel (e.g., admin console, PGP-signed key page). Only then append:
ssh-keyscan -t ed25519 hostname >> ~/.ssh/known_hosts
# If the scanned key doesn't match the trusted key, DO NOT append it.)
# Use specific cipher
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
1. **SOCKS Proxy (Dynamic Port Forwarding)** — No security note about SOCKS5 traffic being unencrypted by default. Users connecting a browser through SOCKS may assume traffic is encrypted.
2. **Remote Port Forwarding (`-R`)** — No warning that `-R` exposes local services to the remote server. This is a significant risk when connecting to untrusted bastion hosts.
3. **SCP Deprecation** — The plan doesn't mention that `scp` is deprecated in modern OpenSSH and `sftp` should be preferred for file transfers.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Disable root login
PermitRootLogin no
# (⚠️ System administrators should use sudo through a bastion host instead of direct root login.)
# Change default port
Port 2222