T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:221- Finding
API Token Exposed Through Command-Line Arguments and URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:44;bin/run.mjs:27, 221-228; related metadata ingenerated/operations.json:23-30andgenerated/operations.md:20
Vulnerability Type: Credential exposure through process arguments and URL query strings
Risk Level: MediumThe documented invocation passes the API token as a command-line argument:
bash node {baseDir}/bin/run.mjs --operation "gwApiAuthorGetAuthorBaseInfoV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"oAuthorId":"<oAuthorId>"}'The operation declares the token as a query parameter:
js { "defaultValue": null, "description": "User authentication token.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" }All parameters declared with the
querylocation, including the token, are inserted into the request 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); } } function appendValue(searchParams, name, value) { if (Array.isArray(value)) { for (const item of value) { appendValue(searchParams, name, item); } return; } if (value && typeof value === "object") { searchParams.append(name, JSON.stringify(value)); return; } searchParams.append(name, String(value)); }Technical Analysis
The token is exposed through two credential-handling mechanisms:
- The documented
--tokenargument places the secret in the Node process command line. Depending on operating-system permissions and deployment configuration, command-line arguments may be visible through process inspection, diagnostic collection, shell histo ...[truncated 2275 chars]
- The documented
- Remediation
View remediation
Remediation Suggestions
- Read the token directly from
process.env.JUST_ONE_API_TOKENinstead of requiring it through--token. Avoid placing credentials in command-line arguments. - Prefer a standard authentication header, such as
Authorization: Bearer ..., if JustOneAPI supports header-based authentication. - If the upstream API exclusively requires query authentication:
- Use a short-lived, narrowly scoped token.
- Ensure application, proxy, gateway, and monitoring configurations redact the
tokenquery parameter. - Do not print or serialize the complete request URL.
- Disable unnecessary HTTP diagnostics that may capture URLs.
- Review redirect handling and reject unexpected redirects to prevent credentials from entering unintended request flows.
- Reject
tokeninside--params-jsonso callers cannot bypass the intended credential source. - Add automated tests verifying that tokens never appear in stdout, stderr, exception payloads, or diagnostic logs.
- Rotate the token immediately if existing process records or URL logs may have retained it.
- Read the token directly from
