T09 · Insecure Skill Coding Practices
- Location
SKILL.md:67- Finding
Persistent Plaintext SMB Credentials at a Predictable Root-Owned Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is not overtly malicious, but its root-level mount guidance includes unsafe password handling and cleartext network examples that users should review carefully.
Review and modify the commands before use. Prefer SFTP or HTTPS WebDAV, avoid cleartext FTP and HTTP WebDAV, do not place passwords in generated shell commands, use a temporary credential file with strict permissions and cleanup, validate all server and mount-point inputs, and approve each sudo command only after checking the fully expanded command.
SKILL.md:67Persistent Plaintext SMB Credentials at a Predictable Root-Owned Path
SKILL.md:77Cleartext FTP and WebDAV Transports Expose Credentials and Mounted Data
SKILL.md:25Unvalidated User Input Is Interpolated into Shell and Privileged Mount Commands
Piping data into a privileged writer (| sudo tee) is a chaining pattern that can amplify mistakes and causes command contents to traverse more surfaces such as logs and transcripts. In this skill, it is especially risky because the same pattern is used immediately adjacent to write a password, making the chaining approach part of an insecure secret-handling workflow.
Credential file method:
# 1. Create credential file
echo "username=$USERNAME" | sudo tee /root/.smbcredentials
echo "password=$PASSWORD" | sudo tee -a /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
This pipeline sends a plaintext password through shell command text into sudo tee, creating multiple opportunities for disclosure via history, telemetry, transcripts, debugging output, or audit tooling. The combination of shell interpolation, pipeline chaining, and root file write makes this a true and material credential-handling vulnerability.
# 1. Create credential file
echo "username=$USERNAME" | sudo tee /root/.smbcredentials
echo "password=$PASSWORD" | sudo tee -a /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
# 2. Mount
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Key-based auth (recommended):
sshfs $USERNAME@SERVER_IP:/ ~/mount_name -o uid=1000,gid=1000
# Use -o identityfile=~/.ssh/id_rsa for key-based auth
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## ⚠️ Security Guidelines
1. **Never pass passwords on command line** — Use credential files or interactive prompts instead
2. **Confirm with user before running sudo commands** — Don't auto-execute privileged operations
3. **Use SSH keys for SFTP** — Avoid password-based authentication
4. **Mount untrusted storage with caution** — It can expose local files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# SMB
sudo apt install smbclient cifs-utils -y
# FTP
sudo apt install curlftpfs -y
This command pipes user-controlled content into sudo tee to create a root-owned credentials file, exposing the username in command text and establishing a risky pattern that is paired with password handling on the next line. Even if the username itself is not highly sensitive, using root pipelines for secret material increases logging and audit exposure and encourages unsafe credential handling.
Credential file method:
# 1. Create credential file
echo "username=$USERNAME" | sudo tee /root/.smbcredentials
echo "password=$PASSWORD" | sudo tee -a /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
The skill claims not to support plaintext passwords on the command line, but the SMB example uses echo "password=$PASSWORD" | sudo tee ..., which places the secret in shell command text and likely shell history, agent logs, transcripts, or process/audit records. This contradiction makes the guidance unsafe because it normalizes insecure handling of credentials while writing them into a root-owned file via a pipeline.
This line writes the SMB password into a root-owned file using echo "password=$PASSWORD" | sudo tee -a ..., directly exposing the secret in command text and likely in shell history, agent transcripts, monitoring, or audit logs. Because the skill explicitly says not to use plaintext passwords on the command line, this is a clear unsafe contradiction.
# 1. Create credential file
echo "username=$USERNAME" | sudo tee /root/.smbcredentials
echo "password=$PASSWORD" | sudo tee -a /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
# 2. Mount
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 1. Create credential file
echo "username=$USERNAME" | sudo tee /root/.smbcredentials
echo "password=$PASSWORD" | sudo tee -a /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
# 2. Mount
sudo mount.cifs //SERVER_IP/share ~/mount_name -o credentials=/root/.smbcredentials,uid=1000,gid=1000
No suspicious patterns detected.