T09 · Insecure Skill Coding Practices
- Location
concertpostergenerator.js:17- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
concertpostergenerator.js:17-19, 36-43;SKILL.md:16-20, 25;README.md:24, 31, 37-38, 43, 65-77
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: MediumVulnerable Code
javascript if (a === '--size') { size = args[++i]; } else if (a === '--token') { tokenFlag = args[++i]; } else if (a === '--ref') { ref = args[++i]; }javascript async function main() { const { prompt, size, tokenFlag, ref } = parseArgs(process.argv); const TOKEN = tokenFlag; if (!TOKEN) { console.error('\n✗ Token required. Pass via: --token YOUR_TOKEN'); console.error(' Get yours at: https://www.neta.art/open/'); process.exit(1); }The documentation consistently instructs users to put the secret in the command line:
bash node concertpostergenerator.js "your prompt here" --token YOUR_TOKENEven the documented environment-variable example expands the secret into the child process argument vector:
bash node concertpostergenerator.js "neon punk show poster" --token "$NETA_TOKEN"Technical Analysis
The application obtains the Neta API token directly from
process.argv. Command-line arguments are not an appropriate secret transport mechanism because they may be exposed through:- Process inspection facilities and monitoring software.
- Shell command history.
- CI/CD logs and task-runner diagnostics.
- Terminal recording and support bundles.
- Audit systems that record process invocation arguments.
Quoting an environment variable does not resolve the issue because the shell expands it before starting Node.js, placing the resulting token in the new process's argument vector.
The script subsequently sends this credential to the documented HTTPS API through the
x-tokenheader. That network use is expected for the skill's function; the vulnerability is the ...[truncated 1117 chars]- Remediation
View remediation
Remediation Suggestions
-
Read the credential directly from an environment variable rather than from
process.argv:javascript const TOKEN = process.env.NETA_TOKEN; if (!TOKEN) { console.error('NETA_TOKEN is required.'); process.exit(1); } -
Alternatively, accept the token through a non-echoing interactive prompt or a protected credential manager.
-
Remove or deprecate the
--tokenoption so users are not encouraged to expose secrets in process metadata. -
Update all examples to avoid literal credentials and command-line expansion:
bash export NETA_TOKEN='token-value' node concertpostergenerator.js "your prompt here" -
Recommend that users disable history while setting sensitive environment variables or load them from a protected secret store.
-
Ensure errors and diagnostics never include the token or complete request headers.
-
Rotate any token known to have been used in logged command lines.
-
