T09 · Insecure Skill Coding Practices
- Location
petrenaissanceportraitgenerator.js:14- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
"your prompt" --token YOUR_TOKEN ``` ### Technical Analysis The script only accepts the Neta API token through the `--token` command-line option. Command-line secrets may be exposed through: - Process inspection facilities while the command is running. - Shell history when a literal token is used. - Process-monitoring, telemetry, debugging, or audit logs. - Wrapper scripts or automation systems that record full command lines. - Error reports that capture process invocation details. Quoting an environment variable, as shown in the README, prevents shell word splitting but does not prevent expansion into the child process argument list. This issue does not transmit the token to an unrelated service: the script legitimately sends it to `api.talesofai.com` as the `x-token` header. The vulnerability concerns its local handling before that request. ### Attack Path 1. A user follows the documented instructions and invokes the script with `--token YOUR_TOKEN` or `--token "$NETA_TOKEN"`. 2. The shell expands the token and places it in the Node.js process argument list. 3. A local process observer, command telemetry system, shell-history reader, or logging component captures the command line. 4. An attacker retrieves the exposed token. 5. The attacker submits unauthorized requests to the Neta API using the victim's credential. This exploitation path requires local access, access to relevant logs, or compromise of a ...[truncated 533 chars]- Remediation
View remediation
