T09 · Insecure Skill Coding Practices
- Location
scripts/kwdb_sql_execute.py:69- Finding
Database Password Exposed Through Process Arguments
- Content
View full analysis
6 else None execute_sql_once(host, port, user, password, sql, output_file) ``` The workflow explicitly requires invocation in this form: ```bash python scripts/kwdb_sql_execute.py "SELECT 1" ``` ### Technical Analysis The database password is supplied as a positional command-line argument and retrieved from `sys.argv[4]`. Command-line arguments can be exposed through operating-system process inspection interfaces, process-monitoring software, audit systems, diagnostic tooling, and command histories. The mandatory consent prompt acknowledges that database configuration is sensitive, but consent does not mitigate the technical exposure. Passing a secret through `argv` is not necessary for the declared anomaly-detection functionality because safer credential channels are available. ### Attack Path 1. A user supplies valid KWDB connection credentials to the Skill. 2. The Skill launches `kwdb_sql_execute.py` using the documented command format. 3. The plaintext password is included in the child process's argument vector. 4. While the process is running, another local user or monitoring component reads the process command line or captures process-execution telemetry. 5. The observer recovers the database username, endpoint, and password. 6. The stolen credentials are used to connect directly to KWDB with all privileges granted to that account. ## ...[truncated 346 chars]- Remediation
View remediation
