T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:138- Finding
API Token Exposed Through Process Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
bin/run.mjs:138-141; documented invocation atSKILL.md:38
Vulnerability Type: API credential exposure through process arguments
Risk Level: MediumVulnerable Code
SKILL.md:38:bash node {baseDir}/bin/run.mjs --operation "getUserVideoListV3" --token "$JUST_ONE_API_TOKEN" --params-json '{"secUid":"<secUid>"}'bin/run.mjs:138-141:js if (flag === "--token") { parsed.token = value; index += 1; continue; }Technical Analysis
The documented execution method expands
JUST_ONE_API_TOKENinto the Node.js process command line. Although the token originates in an environment variable, passing it through--tokencauses the secret value to become part of the process argument vector.Depending on operating-system configuration and local access controls, command-line arguments may be visible to other local users, process-monitoring software, audit agents, crash diagnostics, or orchestration telemetry. The implementation does not print the token directly, but accepting it through a command-line flag unnecessarily expands its exposure surface.
This behavior is not required for the Skill's declared functionality. The runner can read
process.env.JUST_ONE_API_TOKENdirectly without placing the credential in process arguments.Attack Path
- A user invokes the Skill using the documented command.
- The shell expands
$JUST_ONE_API_TOKENinto the value supplied to--token. - The secret appears in the Node.js process argument vector while the process is running.
- A local user or monitoring component with permission to inspect process metadata captures the arguments.
- The observer extracts the API token and reuses it against JustOneAPI.
Exploitation requires local process-observation access or access to telemetry that records command-line arguments.
Impact Assessment
Successful exploitation discloses t ...[truncated 418 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove support for supplying credentials through
--token. -
Read the credential directly from the declared environment variable:
js const token = process.env.JUST_ONE_API_TOKEN; if (!token) { fail("JUST_ONE_API_TOKEN is required.", { operationId: operation.operationId, }); } -
Update
SKILL.mdso the command does not interpolate the token:bash node {baseDir}/bin/run.mjs --operation "getUserVideoListV3" --params-json '{"secUid":"<secUid>"}' -
Ensure diagnostic and error-reporting systems do not capture credential-bearing environment variables.
-
Rotate the token if commands containing it may already have been collected in process telemetry or shell execution logs.
-
Prefer short-lived, narrowly scoped credentials where supported by the service.
-
