T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:27- Finding
API Credential Exposed in URL Query String
- Content
View full analysis
Vulnerability Details
File Location:
bin/run.mjs:27-34,bin/run.mjs:106-107, andbin/run.mjs:242-250
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
js { "defaultValue": null, "description": "User's authentication token.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" }js applyPathParams(operation, params, url); applyQueryParams(operation, params, 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); } }Technical Analysis
The manifest classifies the authentication token as a query parameter. After
injectToken()places the supplied credential inparams.token,applyQueryParams()serializes it into the request URL beforefetch()sends the request to the declared JustOneAPI HTTPS endpoint.HTTPS protects the request from passive network interception, but it does not prevent the full URL from being retained by systems that terminate or process the request. Query strings can appear in destination-server access logs, reverse-proxy logs, API gateway telemetry, monitoring systems, diagnostic traces, and error reports. This creates unnecessary credential exposure compared with sending the token in an authorization header.
The documented invocation also passes the token through the
--tokencommand-line argument. Although the shell expands an environment variable rather than hard-coding the secret, the resulting credential may be visible transiently through local process inspection or command auditing.The outbound network request is necessary for the Skill's declared API functionality, and the destination matches the documented ...[truncated 1556 chars]
- Remediation
View remediation
Remediation Suggestions
-
Change the authentication contract to transmit the token in an HTTP authorization header, preferably:
js const requestInit = { headers: { "accept": "application/json", "authorization": `Bearer ${token}`, }, method: operation.method, }; -
Remove
tokenfromoperation.parametersso it cannot be serialized intourl.searchParams. -
Read the token directly from
process.env.JUST_ONE_API_TOKENrather than requiring it through--token, reducing exposure through process arguments:js const token = process.env.JUST_ONE_API_TOKEN; -
Ensure application errors, traces, and telemetry redact authorization headers and any parameter named
token. -
Update
SKILL.md,generated/operations.json, andgenerated/operations.mdto document the corrected authentication mechanism. -
If the upstream service only supports query-string authentication:
- Clearly document the residual credential-logging risk.
- Configure reverse proxies, gateways, servers, and monitoring systems to redact the
tokenparameter. - Avoid logging complete request URLs.
- Use short-lived, narrowly scoped tokens where supported.
- Rotate any token suspected of appearing in logs.
- Restrict access to existing logs and establish retention limits.
-
