T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:130- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
"}' ``` The executable parses and retains that argument: ```js function parseArgs(argv) { const parsed = { operation: null, paramsJson: "{}", token: null }; for (let index = 0; index < argv.length; index += 1) { const flag = argv[index]; const value = argv[index + 1]; if (flag === "--operation") { parsed.operation = value; index += 1; continue; } if (flag === "--params-json") { parsed.paramsJson = value; index += 1; continue; } if (flag === "--token") { parsed.token = value; index += 1; continue; } fail(`Unknown argument "${flag}".`); } return parsed; } ``` ### Technical Analysis Although the shell command references an environment variable, the shell expands it before starting Node.js. The resulting secret is consequently present in the process argument vector. Depending on the operating system and process isolation configuration, command-line arguments may be observable through process inspection interfaces and utilities, process accounting, monitoring agents, diagnostic reports, or container orchestration telemetry. The code does not need to print the token for this exposure to occur. The Skill otherwise restricts outbound communication to the documented HTTPS host and endpoint. No hidden endpoints, arbitrary command execution, persistence, privilege escalation, or encoded payload execution were identified. The exposure is therefore an insecure credential-handling flaw rather than malicious credential exfiltration. ### ...[truncated 1108 chars]- Remediation
View remediation
