T09 · Insecure Skill Coding Practices
- Location
SKILL.md:49- Finding
Database credentials exposed through command-line arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 49–70
Vulnerability Type: Credentials exposed in process arguments and shell history
Risk Level: MediumVulnerable Code
bash # PostgreSQL psql "postgresql://user:password@host:5432/dbname" -c "\dt" # list tables psql "postgresql://user:password@host:5432/dbname" -c "\d table_name" # describe table psql "postgresql://user:password@host:5432/dbname" -c "SELECT count(*) FROM table_name;"bash # MongoDB mongosh "mongodb://user:password@host:27017/dbname" --eval "db.getCollectionNames()" mongosh "mongodb://user:password@host:27017/dbname" --eval "db.collection_name.countDocuments()"bash # Redis redis-cli -h host -p 6379 -a password INFO keyspace redis-cli -h host -p 6379 -a password DBSIZE redis-cli -h host -p 6379 -a password KEYS "*"Technical Analysis
The documented command templates place database passwords directly in command-line arguments. If an agent substitutes actual credentials into these templates, those credentials may become visible through:
- Shell command-history files
- Process argument inspection
- Process-monitoring and diagnostic tools
- Terminal session recording
- Agent execution logs or command telemetry
- Error reports that reproduce the invoked command
This behavior also conflicts with the skill's line 80 safety rule, which states that passwords should not be placed in history. A connection URI containing a password remains unsafe when the URI is passed directly as a command-line argument.
The examples contain placeholders rather than real embedded credentials, but they encourage an insecure credential-handling pattern that can expose real secrets during use.
Attack Path
- A user provides valid PostgreSQL, MongoDB, or Redis credentials to the agent.
- The agent substitutes those credentials into one of the documented command templates.
- The shell, ...[truncated 1073 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all examples that place passwords directly in connection URIs or command arguments.
- Use each client's protected credential mechanism:
- PostgreSQL:
.pgpassorPGPASSFILEwith restrictive file permissions. - MySQL:
mysql_config_editorand encrypted login paths. - MongoDB: interactive password prompting or a protected configuration mechanism.
- Redis:
REDISCLI_AUTHor a protected configuration file rather than-a.
- PostgreSQL:
- Ensure generated credential files are owned by the executing user and use mode
0600. - Disable shell history while handling secrets where appropriate, while recognizing that this does not prevent process-argument exposure.
- Redact credentials from terminal output, execution logs, error reports, and agent responses.
- Prefer short-lived, narrowly scoped database credentials.
- Add an explicit rule prohibiting passwords in command arguments, rather than recommending connection strings as a safe alternative.
