T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:203- Finding
API Token Exposed Through Process Arguments and URL Query Parameters
- Content
View full analysis
"}' ``` The helper parses the token directly from the process argument list: ```js if (flag === "--token") { parsed.token = value; index += 1; continue; } ``` It then copies the token into the request parameters: ```js function injectToken(operation, params, cliToken) { const tokenParam = operation.parameters.find((parameter) => 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 `token`, are appended to the 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 resulting URL is submitted to the remote API: ```js let response; try { response = await fetch(url, requestInit); } catch (error) { ``` ### Technical Analysis The JustOneAPI credential is exposed through two channels: 1. Supplying it through `--token` places the secret in the process argument vector. Depending on operating-system permissions and deployment configuration, process inspection, shell tracing, job telemetry, crash diagnostics, or command auditing may record or expose that value. 2. T ...[truncated 1919 chars]- Remediation
View remediation
