T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:25- Finding
API Token Exposed Through Process 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 request URL: ```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 command also places the token in the process argument list: ```bash node {baseDir}/bin/run.mjs --operation "searchBilibiliVideoV2" --token "$JUST_ONE_API_TOKEN" --params-json '{"keyword":""}' ``` ### Technical Analysis The API credential is exposed through two related channels: 1. Passing the token using `--token` places its expanded value in the Node process co ...[truncated 2876 chars]- Remediation
View remediation
