T09 · Insecure Skill Coding Practices
- Location
scripts/query.sh:18- Finding
Database Passwords Exposed Through Process Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
"$CREDENTIAL_FILE" <
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real MySQL SQL assistant, but it handles database passwords and transaction output in ways that can expose sensitive information.
Install only if you are comfortable with a skill that can run SQL against MySQL databases. Use least-privilege database accounts, avoid production credentials, avoid passing passwords on the command line, and review generated SQL before any write, delete, drop, truncate, or transaction operation.
scripts/query.sh:18Database Passwords Exposed Through Process Command-Line Arguments
SKILL.md:72Predictable SQL Files in the Shared Temporary Directory
scripts/transaction.sh:26Transaction Statements May Be Disclosed Through Verbose MySQL Output
The declared description presents a full-featured natural-language SQL assistant with broad database execution capabilities. The actual code is much narrower: it only parses connection flags and runs one hardcoded MySQL query to enumerate databases. While the code does use MySQL connection info as described, its primary behavior is limited to database listing and does not implement the core claimed functionality of translating natural language into SQL or executing arbitrary database operations. This is a material description-behavior mismatch.
The declared description promises a broad NL-to-SQL assistant capable of generating and executing arbitrary SQL against MySQL, including data modification, transactions, and multiple output formats. The supplied code does something much narrower: it accepts a database and optional table name plus connection flags, then runs SHOW TABLES and SHOW CREATE TABLE to display schema definitions. While remote MySQL connection support via host/port/user/password is consistent with part of the description, the core behavior is materially different. There is no natural-language handling, no SQL synthesis, no execution of user-specified queries, no CRUD operations beyond schema inspection, and no transaction or export-format support. Therefore the description significantly overstates and misrepresents the code's actual purpose.
The declared description presents a full natural-language SQL assistant whose primary function is translating user requests into SQL and executing them, with broad database operation support and multiple output formats. The supplied code does not do any natural language processing or SQL generation. It only reads an existing SQL file and pipes it to the MySQL client within an explicit transaction, using optional remote connection arguments. While parts of the description overlap—MySQL connectivity, execution of SQL, and transaction support—the main advertised capability is missing, and the implemented behavior is materially narrower than described.
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
### DELETE
- **Always include a WHERE clause** — never generate bare `DELETE FROM ...`
- Prefer soft-delete (status field) if table has one
- Confirm with user before generating DELETE statements
### Transactions
- Use transactions when:
The trigger conditions are extremely broad and cover common phrases such as querying databases, writing SQL, modifying data, exporting, and connecting to databases. In an agent environment, this can cause the skill to activate unexpectedly on routine conversations and grant a path to database-oriented actions, increasing the chance of unintended data access, destructive operations, or credential handling in the wrong context.
The manifest describes a natural-language-to-SQL assistant that can generate SQL, execute user-requested CRUD and transaction operations, and return results in multiple formats. This file's actual behavior is much narrower: it only accepts connection parameters and runs a fixed query against information_schema to enumerate databases, with no natural-language parsing, arbitrary SQL execution, write operations, transactions, or selectable output formats.
The script accepts a database password via a command-line argument and forwards it as -pPASSWORD to mysql, which can expose secrets through process listings, shell history, audit logs, or orchestration telemetry. In a skill that allows user-supplied remote database credentials, this becomes more dangerous because highly sensitive credentials may be routinely passed through an unsafe channel.
The script accepts the database password via the --password flag and passes it to mysql as -p<password>, which exposes the secret in process arguments. On many systems, command-line arguments can be observed by other local users via tools like ps, shell history, logging, job control output, or orchestration telemetry, causing credential disclosure. In this skill's context, the risk is elevated because it explicitly supports remote MySQL connections and user-supplied credentials, increasing the likelihood that real production passwords will be handled this way.
The script accepts the database password via a --password argument and passes it to mysql as -p, which exposes the credential in process arguments. On many systems, command-line arguments can be read by other local users through process listings, shell history, audit logs, or orchestration metadata, causing credential disclosure. In this skill's context, the risk is elevated because it explicitly supports remote MySQL connections with user-supplied credentials, increasing the likelihood that real production secrets are handled this way.
The instruction 'Chinese aliases when user speaks Chinese' imposes a language-specific output rule automatically rather than offering a user choice. This can violate language/locale policy requirements when a skill should not force a locale without explicit opt-in or documented justification.
The script forces Chinese-language output strings and column aliases, which is a natural-language locale constraint embedded in a code file. There is no opt-in, fallback, or documentation indicating that the tool is intentionally region-specific.
No suspicious patterns detected.