T09 · Insecure Skill Coding Practices
- Location
SKILL.md:24- Finding
Plaintext MongoDB credentials are recommended for persistent project storage
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed MongoDB troubleshooting helper, but it encourages unsafe handling of database credentials and can automatically open Kubernetes port-forwards.
Review before installing. Use only least-privilege MongoDB credentials, avoid putting passwords in TOOLS.md or command history, prefer a protected secret source, and be careful with Kubernetes contexts because the skill can create port-forwards to services reachable by kubectl.
SKILL.md:24Plaintext MongoDB credentials are recommended for persistent project storage
SKILL.md:42Credential-bearing MongoDB URIs are passed through command-line arguments
SKILL.md:13Unpinned PyMongo dependency installation reduces supply-chain integrity
The skill invokes shell and network-capable behavior but does not declare any tool scope or allowed-tools boundary. That increases the chance an agent can use broader execution or connectivity than reviewers expect, especially since the skill can reach arbitrary MongoDB endpoints and may invoke kubectl port-forward.
The documentation explicitly recommends saving full MongoDB connection strings, including credentials, into TOOLS.md for reuse. Storing secrets in project documentation risks credential leakage through source control, logs, sharing, backups, or later agent reads, and the exposed URI can provide direct database access.
This guidance promotes persistent storage of full connection strings with embedded usernames and passwords in reusable project files. In the context of a database-query skill, that is especially dangerous because the same file may later be read by tools, agents, or collaborators, turning troubleshooting documentation into a credential disclosure channel.
This skill does more than query MongoDB: when the host is not an IP, it automatically creates a kubectl port-forward to an in-cluster service. That expands the tool's privilege boundary from database access into Kubernetes-mediated network access, which can expose internal services and enable unintended lateral access paths if a user supplies an internal service name.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"Starting port-forward: {' '.join(cmd)}", file=sys.stderr)
try:
port_forward_process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
preexec_fn=os.setsid
)
# Wait a bit for port-forward to establish