T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:21- Finding
API Token Exposed Through URL Query Parameters and 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; } ``` ```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 documented invocation also passes the secret through a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "getMovieCommentsV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"subjectId":""}' ``` ### Technical Analysis The access token is transmitted as part of the URL query string. Although the des ...[truncated 2408 chars]- Remediation
View remediation
"}' ``` The implementation should then retrieve `JUST_ONE_API_TOKEN` directly from the environment and avoid exposing its value in errors, output, or diagnostics. ]]>
