T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:23- Finding
API Token Exposed Through Command-Line Arguments and URL Query Parameters
- 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; } ``` All query parameters, including the token, are appended to the URL before transmission: ```js function applyQueryParams(operation, params, url) { for (const parameter of operation.parameters.filter((item) => item.location === "query")) { const value = params[parameter.name]; if (value === undefined) { continue; } appendValue(url.searchParams, parameter.name, value); } } ``` The resulting URL is sent to the declared remote API: ```js applyQueryParams(operation, params, url); const requestInit = { headers: { "accept": "application/json", }, method: operation.method, }; response = await fetch(url, requestInit); ``` The documented invocation also expands the secret into a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "getWeiboDetailsV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"id":""}' ``` ### Technical Analysis The Skill legitimately requires authentication to call `https://api.justoneapi.c ...[truncated 3278 chars]- Remediation
View remediation
