T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:14
- Finding
- API Credential Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:14` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash node {baseDir}/scripts/generate.mjs "$SKILLBOSS_API_KEY" "A sunset over mountains" ``` ### Technical Analysis The documented invocation passes `SKILLBOSS_API_KEY` as a positional command-line argument. The script subsequently reads the credential from `process.argv`. Command-line arguments can be exposed through process inspection interfaces, local monitoring agents, diagnostic tooling, audit records, or execution logs. Whether another local user can read them depends on operating-system configuration, but passing secrets through process arguments unnecessarily expands credential exposure. This is not required for the declared image-generation functionality. The Skill already declares `SKILLBOSS_API_KEY` as a required environment variable, so the script can read it directly from `process.env` without copying it into the process argument list. ### Attack Path 1. A user invokes the Skill using the documented command. 2. The shell expands `$SKILLBOSS_API_KEY` and places its value in the Node process argument list. 3. An attacker or monitoring system with permission to inspect process metadata or execution records captures the command-line arguments while the process is running. 4. The attacker extracts the API key. 5. The attacker reuses the key against the associated API, subject to the permissions and limits assigned to that credential. ### Impact Assessment Successful exploitation discloses the API credential. The attacker could consume the associated image-generation service, incur account charges, exhaust quotas, or perform any other operation authorized by that key. This issue does not directly grant operating-system privileges. Its scope is limited to the permissions of the exposed API credential and any information available through the correspondin ...[truncated 24 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the API key from the documented positional arguments. - Read the credential directly from the declared environment variable: ```js const apiKey = process.env.SKILLBOSS_API_KEY?.trim(); if (!apiKey) { console.error("Missing SKILLBOSS_API_KEY"); process.exit(1); } const prompt = process.argv[2]; ``` - Change the documented invocation to: ```bash node {baseDir}/scripts/generate.mjs "A sunset over mountains" ``` - Ensure command execution, telemetry, and error logging systems redact credential values. - Rotate any credential suspected of having been recorded in process telemetry or logs. ]]>
