T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:128- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
parameter.name === "token"); if (!tokenParam || params.token !== undefined) { return; } if (!cliToken) { fail("--token is required for this operation.", { operationId: operation.operationId, }); } params.token = cliToken; } ``` The documented invocation passes the environment variable through a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "getUserRelationStat" --token "$JUST_ONE_API_TOKEN" --params-json '{"wmid":""}' ``` ### Technical Analysis The shell expands `$JUST_ONE_API_TOKEN` before starting Node.js, placing the resulting secret in the process argument vector. Although the token is not printed directly by the Skill, command-line arguments can be exposed through process inspection, host telemetry, audit systems, crash diagnostics, debugging tools, or process-monitoring agents. This exposure is unnecessary because the Skill already declares `JUST_ONE_API_TOKEN` as its required environment variable. The executable could read that variable directly without copying its value into the process arguments. Exploitation requires local process-observation capability or access to telemetry that records command lines. This does not grant an unauthenticated remote attacker access by itself. ### Attack Path 1. A user invokes the Skill using the documented command and supplies the token through `--token "$JUST_ONE_API_TOKEN"`. 2. The shell expands the environment variable and includes the plaintext token in the Node.js process arguments. 3. An atta ...[truncated 749 chars]- Remediation
View remediation
"}' ``` 5. Ensure error messages, diagnostics, and telemetry never include the token. 6. Recommend revocation and rotation of tokens that may previously have been captured by process-monitoring or command-line telemetry. ]]>
