T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:21- Finding
API Token Exposed Through Process Arguments and URL Query Parameters
- Content
View full analysis
"}' ``` `bin/run.mjs:21-29`: ```js { "defaultValue": null, "description": "Authentication token for this API service.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" } ``` `bin/run.mjs:63-75`: ```js const params = parseParams(args.paramsJson); applyDefaults(operation, params); injectToken(operation, params, args.token); validateRequired(operation, params); const baseUrl = manifest.baseUrl; const url = new URL(operation.path, ensureBaseUrl(baseUrl)); applyPathParams(operation, params, url); applyQueryParams(operation, params, url); const requestInit = { headers: { "accept": "application/json", }, method: operation.method, }; ``` `bin/run.mjs:142-145`: ```js if (flag === "--token") { parsed.token = value; index += 1; continue; } ``` `bin/run.mjs:218-225`: ```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); } } ``` ### Technical Analysis The documented invocation passes `JUST_ONE_API_TOKEN` through the `--token` command-line argument. Command-line arguments may be visible to other local processes or administrators through process-inspection facilities and may also be retained in shell tracing, job metadata, diagnostic output, or execution telemetry. The manifest declares ...[truncated 2498 chars]- Remediation
View remediation
