T09 · Insecure Skill Coding Practices
- Location
SKILL.md:40- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
" --token "$JUST_ONE_API_TOKEN" --params-json '{"key":"value"}' ``` `bin/run.mjs:183-193`: ```js if (flag === "--params-json") { parsed.paramsJson = value; index += 1; continue; } if (flag === "--token") { parsed.token = value; index += 1; continue; } fail(`Unknown argument "${flag}".`); ``` ### Technical Analysis The documented invocation passes `JUST_ONE_API_TOKEN` as the value of the `--token` command-line argument. Shell variable expansion places the actual secret in the Node process argument vector. Depending on the operating system and deployment environment, process arguments may be available through process-inspection utilities, `/proc` metadata, container monitoring, execution telemetry, audit systems, or diagnostic tooling. This creates an unnecessary secondary disclosure channel for a credential that the Skill documentation explicitly requires users to keep private. Passing authentication information is necessary for the declared API functionality, but exposing it through a command-line argument is not required. The helper can read the already-required `JUST_ONE_API_TOKEN` environment variable directly. ### Attack Path 1. A user follows the documented command and supplies the API token through `--token`. 2. The shell expands `$JUST_ONE_API_TOKEN`, placing the plaintext credential in the process argument vector. 3. An attacker or monitoring system with permission to inspect process metadata records or reads the command line while the helper is running. 4. The observer extracts the token from the `--token` argument. 5. The token is reused to make unauthorized requests to JustOneAPI within the privileges and service limits assigned to that credential. ### ...[truncated 453 chars]- Remediation
View remediation
