T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:1146- Finding
API Token Exposed Through Process Arguments and URL Query Parameters
- Content
View full analysis
" --token "$JUST_ONE_API_TOKEN" --params-json '{"key":"value"}' ``` The manifest defines the token as an HTTP query parameter: ```js { "defaultValue": null, "description": "User's authentication token.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" } ``` The runtime accepts the secret from the command line, injects it into the parameter object, appends all query parameters to the URL, and sends the resulting request: ```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, }; let response; try { response = await fetch(url, requestInit); } catch (error) { fail("Network request failed.", { cause: error instanceof Error ? error.message : String(error), operationId: operation.operationId, }); } ``` Command-line parsing and token injection are implemented as follows: ```js function parseArgs(argv) { const parsed = { operation: null, params ...[truncated 4470 chars]- Remediation
View remediation
