T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
Database Password Exposed Through Process Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 34; the same unsafe pattern is repeated at lines 53, 59, 65, 71, 77, 83, and 89
Vulnerability Type: Command-line credential exposure
Risk Level: HighVulnerable Code
bash ${MSSQL_SQLCMD:-sqlcmd} -S $MSSQL_HOST -U $MSSQL_USER -P $MSSQL_PASSWORD -d $MSSQL_DB -C -W -Q "YOUR_QUERY"Technical Analysis
The documented connection command supplies the database password through the
sqlcmd-Pargument. After shell expansion, the plaintext password becomes part of the process command line.Depending on operating-system permissions and runtime configuration, command-line arguments may be visible through process inspection facilities, administrative monitoring agents, diagnostic captures, audit logs, crash reports, or enabled shell tracing. This undermines the stated rule that credentials must never be exposed.
The vulnerability occurs whenever the Agent follows any of the documented commands containing:
bash -P $MSSQL_PASSWORDAttack Path
- A user or Agent invokes one of the documented
sqlcmdcommands. - The shell expands
$MSSQL_PASSWORDinto its plaintext value. - The resulting password is included in the
sqlcmdprocess arguments. - An attacker with access to process metadata, privileged host telemetry, diagnostic logs, or command tracing captures the argument while the process runs or from retained records.
- The attacker uses the exposed host, username, password, and database details to authenticate to SQL Server.
- The attacker performs operations allowed by the compromised database account.
This attack requires suitable local observation, monitoring, logging, or diagnostic access; the document does not itself transmit the credential externally.
Impact Assessment
A successful attacker obtains the reusable SQL Server password. The resulting scope is bounded by the permissions assigned to
MSSQL_USER, but may include:- Reading sensitive records ...[truncated 454 chars]
- A user or Agent invokes one of the documented
- Remediation
View remediation
Remediation Suggestions
- Do not pass database passwords through the
-Pcommand-line option. - Prefer an approved authentication mechanism that avoids reusable command-line secrets, such as:
- Windows or Kerberos integrated authentication where available.
- Microsoft Entra authentication supported by the installed
sqlcmdversion. - A protected credential configuration or enterprise secret provider.
- If password authentication is unavoidable, use a supported input mechanism that does not place the password in process arguments and ensure that it cannot be recorded by shell history or tracing.
- Run the database client under a dedicated, least-privileged operating-system identity.
- Assign the database identity only the minimum permissions required for schema inspection and read operations.
- Disable command tracing around credential-bearing operations and review monitoring, crash-reporting, and audit systems for command-line collection.
- Rotate the configured SQL Server password if the documented command has already been used in an environment where process arguments may have been retained.
- Update every repeated command at lines 53, 59, 65, 71, 77, 83, and 89 rather than correcting only the primary example.
- Do not pass database passwords through the
