T09 · Insecure Skill Coding Practices
- Location
retrotravelpostergenerator.js:84- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
retrotravelpostergenerator.js:17-20, 84-90; usage is also documented inSKILL.md:17-21, 26-29andREADME.md:47-55
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
javascript function parseArgs(args) { const out = { prompt: null, size: 'portrait', token: null, ref: null }; const positional = []; for (let i = 0; i < args.length; i++) { const a = args[i]; if (a === '--size') { out.size = args[++i]; } else if (a === '--token') { out.token = args[++i]; }javascript async function main() { const { prompt: promptArg, size, token: tokenFlag, ref } = parseArgs(argv.slice(2)); 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/'); exit(1); }The documented invocation explicitly places the secret on the command line:
bash node retrotravelpostergenerator.js "your description here" --token YOUR_TOKENTechnical Analysis
The Neta API token is accepted exclusively as a command-line argument. Command-line arguments are not an appropriate secret-transport mechanism because they may be recorded in shell history, terminal logs, process-monitoring systems, debugging output, or operating-system process metadata.
On systems where process arguments are visible to other users or monitoring agents, the token can remain observable while the script is submitting and polling the image-generation task. Even after the process exits, the command can remain in the invoking user's shell history. The script does not disclose the token in its own normal output, but that does not mitigate exposure caused by the invocation mechanism.
Sending the token in the
x-tokenheader over HTTPS toapi.talesofai.comis consistent wit ...[truncated 1425 chars]- Remediation
View remediation
Remediation Suggestions
-
Prefer an environment variable, such as
NETA_API_TOKEN, rather than a command-line flag:javascript const TOKEN = process.env.NETA_API_TOKEN; -
For interactive use, support reading the token from a non-echoing terminal prompt.
-
For automation, support reading the token from standard input or a permission-restricted credential file, without printing it.
-
If
--tokenmust remain for compatibility, mark it deprecated and emit a warning explaining its process-list and shell-history risks. -
Update all examples in
README.mdandSKILL.mdso they do not encourage placing a real secret directly in command history. -
Ensure errors, debugging output, and telemetry redact token values.
-
Recommend short-lived, least-privilege tokens and document immediate revocation procedures for suspected exposure.
-
