T09 · Insecure Skill Coding Practices
- Location
darkacademiaartgenerator.js:17- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
darkacademiaartgenerator.js:17-23, 96-101;SKILL.md:17-24;README.md:17-19, 61-65
Vulnerability Type: Sensitive credential exposure through process arguments and shell history
Risk Level: MediumThe documented and implemented authentication mechanism requires users to supply the Neta API token through the
--tokencommand-line argument.javascript } else if (a === '--token') { tokenFlag = args[++i]; } else if (a === '--ref') { ref = args[++i]; } else if (!a.startsWith('--') && prompt === null) { prompt = a; }The token is subsequently retrieved from the parsed command-line arguments:
javascript const args = parseArgs(argv.slice(2)); const PROMPT = args.prompt || DEFAULT_PROMPT; const TOKEN = args.tokenFlag; if (!TOKEN) { console.error('\n✗ Token required. Pass via: --token YOUR_TOKEN'); console.error(' Get yours at: https://www.neta.art/open/');The documentation explicitly instructs users to place the secret on the command line:
bash node darkacademiaartgenerator.js "your description here" --token YOUR_TOKENTechnical Analysis
Command-line arguments are not a suitable secret transport mechanism. Depending on the operating system and runtime environment, process arguments may be exposed through process inspection interfaces, monitoring agents, audit logs, command telemetry, diagnostic reports, or container orchestration metadata. The command may also be retained in the user's shell history.
An attacker does not need to compromise the remote image-generation service. A local user, administrative monitoring component, or other process with permission to inspect the invocation can capture the token while the command is running or recover it later from shell history.
The token is legitimately required for the declared image-generation functionality, and transmitting it to the image-generation AP ...[truncated 1133 chars]
- Remediation
View remediation
Remediation Suggestions
-
Support a protected environment variable such as
NETA_API_TOKENinstead of requiring a command-line argument. -
Prefer secret input through standard input or a hidden interactive prompt when practical.
-
If backward compatibility requires
--token, mark it as deprecated and clearly warn that process arguments and shell history may expose it. -
Update all examples to avoid placing literal credentials in commands, for example:
bash export NETA_API_TOKEN="..." node darkacademiaartgenerator.js "your description here" -
Ensure errors and diagnostic output never print the token.
-
Recommend short-lived, narrowly scoped tokens where supported and provide token-revocation guidance.
-
