T09 · Insecure Skill Coding Practices
- Location
SKILL.md:23- Finding
API Key Exposed Through Command-Line Arguments
- Content
View full analysis
" # non-interactive ``` ### Technical Analysis The documented non-interactive login method places an API key directly in the command-line argument list. Depending on the operating system, shell, and execution environment, command-line arguments may be exposed through: - Shell history files - Process inspection facilities - Terminal session recordings - Agent or automation execution logs - Monitoring and auditing systems - Error reports that capture invoked commands Although the document also provides a secure interactive login command, the unsafe argument-based method remains explicitly documented and may be selected for automation. ### Attack Path 1. A user or Agent follows the documented non-interactive login example. 2. The API key is expanded into the command line as plaintext. 3. The shell, Agent framework, process monitor, or logging system records or exposes the command. 4. A local user or log reader retrieves the API key. 5. The exposed credential is used to authenticate to the Indices service, subject to the permissions and validity of that API key. ### Impact Assessment Successful exploitation discloses the user's Indices API credential. An attacker may obtain the remote privileges assigned to that key, potentially including access to authentication-protected task, run, and secret-management operations. The precise scope is limited by the service-side permissions, expiration, and revocation state of the compromised credential. ]]>- Remediation
View remediation
"` example from the recommended workflow. - Prefer `indices login`, which obtains the key through a secure interactive prompt. - For non-interactive automation, support a protected input channel such as an inherited file descriptor or standard input without echoing or logging its contents. - If environment-variable support is introduced, ensure automation systems mask the variable and do not print the environment in logs. - Configure the CLI and Agent runtime to redact credential-bearing arguments from command traces, diagnostics, and audit logs. - Advise users to rotate any API key that may already have appeared in shell history or execution logs. - Use narrowly scoped, short-lived API credentials where the service supports them. ]]>
