T09 · Insecure Skill Coding Practices
- Location
floatingproductgenerator.js:17- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
floatingproductgenerator.js, lines 13-24 and 139-145; documented inSKILL.md, lines 14-22, andREADME.md, lines 60-67
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
javascript function parseArgs(argv) { const args = { _: [] }; for (let i = 0; i < argv.length; i++) { const a = argv[i]; if (a === '--size') args.size = argv[++i]; else if (a === '--token') args.token = argv[++i]; else if (a === '--ref') args.ref = argv[++i]; else if (a === '--help' || a === '-h') args.help = true; else args._.push(a); } return args; }javascript const tokenFlag = args.token; 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 documented invocation reinforces this handling:
bash node floatingproductgenerator.js "your prompt" --token YOUR_TOKENTechnical Analysis
The Skill requires users to supply the Neta API token as a command-line argument. Command-line arguments can be recorded in shell history and may be observable through local process-inspection interfaces, system monitoring agents, audit logs, crash diagnostics, or process telemetry.
The program subsequently sends the token in the
x-tokenHTTP header tohttps://api.talesofai.com. Sending the credential to this service is necessary for the declared image-generation functionality and is protected by HTTPS. The vulnerability is therefore not the intended API transmission itself, but the unnecessary exposure caused by accepting and documenting the token directly on the command line.No token logging, unrelated credential collection, or transmission to additional domains was found.
Attack Path
- A user foll ...[truncated 1223 chars]
- Remediation
View remediation
Remediation Suggestions
- Make a protected environment variable, such as
NETA_TOKEN, the primary credential input:javascript const TOKEN = process.env.NETA_TOKEN; - Alternatively, accept the token through standard input or an interactive hidden prompt so it does not appear in process arguments.
- Remove commands containing literal token placeholders from the primary usage path. Document a safer workflow:
bash export NETA_TOKEN='...' node floatingproductgenerator.js "your prompt" - If
--tokenmust remain for compatibility, clearly warn that it may expose the credential through shell history and process listings. - Ensure errors never include request headers or token values.
- Encourage users to assign the minimum available API permissions, rotate exposed tokens, and configure usage limits where the provider supports them.
- Make a protected environment variable, such as
