T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:21- Finding
Authentication Token Transmitted in the URL Query String
- Content
View full analysis
Vulnerability Details
File Location:
bin/run.mjs:21-29,bin/run.mjs:94-96, andbin/run.mjs:227-234
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
js { "defaultValue": null, "description": "User authentication token.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" }js 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, };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 manifest defines the authentication token as a required query parameter. The
injectTokenfunction places the supplied credential intoparams.token, after whichapplyQueryParamsappends every query parameter—including the token—to the request URL.HTTPS protects the URL while it is in transit between the client and the server, but it does not prevent the complete URL from being retained by components that process the request. Query strings may be captured by reverse proxies, API gateways, server access logs, debugging tools, monitoring systems, browser or HTTP diagnostics, and error telemetry.
Sending the credential to the fixed
https://api.justoneapi.comendpoint is consistent with the Skill's declared functionality and is not evidence of co ...[truncated 1256 chars]- Remediation
View remediation
Remediation Suggestions
-
Change the API authentication contract to use an HTTP authorization header, for example:
js const requestInit = { headers: { accept: "application/json", authorization: `Bearer ${token}`, }, method: operation.method, }; -
Remove
tokenfrom the operation's query-parameter definition and ensure it is never passed toURLSearchParams. -
If the upstream service cannot immediately be changed, configure clients, reverse proxies, gateways, servers, and monitoring systems to redact the
tokenquery parameter before logging or exporting telemetry. -
Avoid including complete request URLs in error messages and diagnostics.
-
Rotate any tokens that may already have appeared in URL-bearing logs, and restrict access to historical logs.
-
Apply short expiration periods, narrow API scopes, usage alerts, and rate limits to reduce the impact of future token disclosure.
-
