T09 · Insecure Skill Coding Practices
- Location
disposablecameraphotogenerator.js:14- Finding
API Token Exposed Through Command-Line Arguments
- Content
View full analysis
0) args.prompt = rest.join(' '); return args; } async function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); } async function main() { const { size, prompt, token: tokenFlag, ref } = parseArgs(process.argv.slice(2)); const TOKEN = tokenFlag; ``` The insecure invocation is explicitly recommended in the documentation: ```bash node disposablecameraphotogenerator.js "your prompt" --token YOUR_TOKEN ``` ### Technical Analysis The application requires users to provide the Neta API token through the `--token` command-line option and retrieves it from `process.argv`. Command-line arguments are not an appropriate secret transport mechanism because they may be recorded in shell history, process-monitoring telemetry, crash diagnostics, terminal logs, or automation logs. Depending on operating-system process visibility controls, other local users or processes may also be able to inspect the command line while the program is running. The exposure window is material because the process polls the remote service for up to approximately three minutes. The appli ...[truncated 1266 chars]- Remediation
View remediation
