T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:45; token argument handling inbin/run.mjs:183-196
Vulnerability Type: API credential exposure through process arguments
Risk Level: MediumThe documented invocation explicitly passes the JustOneAPI credential through the
--tokencommand-line argument:bash node {baseDir}/bin/run.mjs --operation "titleExtendedDetailsQuery" --token "$JUST_ONE_API_TOKEN" --params-json '{"id":"<id>"}'The helper accepts that argument and places its value in the request parameters:
js function injectToken(operation, params, cliToken) { const tokenParam = operation.parameters.find((parameter) => parameter.name === "token"); if (!tokenParam || params.token !== undefined) { return; } if (!cliToken) { fail("--token is required for this operation.", { operationId: operation.operationId, }); } params.token = cliToken; }Technical Analysis
Secrets supplied as command-line arguments can be exposed through process metadata. Depending on the operating system and deployment environment, command arguments may be available to other local users, process-monitoring agents, container administrators, job runners, shell auditing facilities, or diagnostic tooling.
Although shell expansion of
"$JUST_ONE_API_TOKEN"prevents the value from being written literally into the shell command, the expanded secret is still delivered to Node.js as an argument. Authentication is necessary for the Skill's declared functionality, but exposing the credential throughargvis not the minimum safe privilege or disclosure required.Attack Path
- A user or agent follows the documented command and invokes the helper with
--token "$JUST_ONE_API_TOKEN". - The shell expands the environment variable and places the credential in the process argument vector.
- A local user, process-monitoring service, container administrator, or audit system records or reads the command line while the ...[truncated 757 chars]
- A user or agent follows the documented command and invokes the helper with
- Remediation
View remediation
Remediation Suggestions
- Remove
--tokenfrom the documented command and command-line parser. - Read the credential directly from
process.env.JUST_ONE_API_TOKENinside the Node.js process:js const token = process.env.JUST_ONE_API_TOKEN; if (!token) { fail("JUST_ONE_API_TOKEN is required."); } - Prefer a secret manager or protected environment-variable injection mechanism in CI, container, and production environments.
- Never include the token in process titles, command diagnostics, screenshots, telemetry, or error messages.
- Document the required environment variable without showing users how to place its expanded value in
argv. - Rotate any token that may already have been captured by process-monitoring or command-auditing systems.
- Remove
