T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:123- Finding
KeyAPI Bearer Token Persisted in Plaintext and Exposed During Setup
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is coherent for Amazon KeyAPI research, but its setup helper stores an API token persistently in shell profile files with insufficient warning and controls.
Install only if you are comfortable with a local helper that can write your KeyAPI token into a shell startup profile in plaintext. Prefer setting KEYAPI_TOKEN only for the current shell session or using a dedicated credential store, and avoid passing tokens on the command line.
scripts/configure-keyapi-auth.mjs:123KeyAPI Bearer Token Persisted in Plaintext and Exposed During Setup
scripts/configure-keyapi-auth.mjs:25Arbitrary Writable File Modification Through Unrestricted Profile Path
Referenced artifact was not completely inspected
2. Check auth with `node scripts/configure-keyapi-auth.mjs --status` when script execution is available and setup state is unknown; treat `authStatus: "availabl
Referenced artifact was not completely inspected
2. Check auth with `node scripts/configure-keyapi-auth.mjs --status` when script execution is available and setup state is unknown; treat `authStatus: "availabl
Referenced artifact was not completely inspected
2. Check auth with `node scripts/configure-keyapi-auth.mjs --status` when script execution is available and setup state is unknown; treat `authStatus: "availabl
Referenced artifact was not completely inspected
2. Check auth with `node scripts/configure-keyapi-auth.mjs --status` when script execution is available and setup state is unknown; treat `authStatus: "availabl
Referenced artifact was not completely inspected
2. Check auth with `node scripts/configure-keyapi-auth.mjs --status` when script execution is available and setup state is unknown; treat `authStatus: "availabl
Referenced artifact was not completely inspected
9. Resolve current docs with `node scripts/search-keyapi-docs.mjs --query "<semantic entity action>" --resolve` when the helper script is available; otherwise o
Referenced artifact was not completely inspected
9. Resolve current docs with `node scripts/search-keyapi-docs.mjs --query "<semantic entity action>" --resolve` when the helper script is available; otherwise o
Referenced artifact was not completely inspected
9. Resolve current docs with `node scripts/search-keyapi-docs.mjs --query "<semantic entity action>" --resolve` when the helper script is available; otherwise o
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
12. Prefer `node scripts/keyapi-api.mjs` for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or
Referenced artifact was not completely inspected
a different current working directory, resolve `scripts/...` relative to this `SKILL.md`. For large JSON bodies, especially base64 image payloads, prefer `--bo
The script persists KEYAPI_TOKEN into the user's shell profile, causing long-lived storage of a sensitive credential in plaintext. While this may be intended as a convenience setup step, it exceeds the immediate needs of a marketplace-analysis skill and increases exposure through profile-file disclosure, backups, shared accounts, and accidental commits or support-file sharing.
The interactive prompt uses rl.question() on standard input, so the token is visibly echoed as the user types, and the script does not warn that the secret will also be persisted to the shell profile. This creates unnecessary secret exposure to shoulder-surfing, terminal logs/recordings, and user misunderstanding about where the credential is stored.
The manifest describes a skill for exploring Amazon marketplace data via the KeyAPI REST API. While using a token is expected, this implementation goes beyond simple request handling by inspecting the user's shell startup files and environment to recover credentials, a capability not stated in the purpose and not directly tied to marketplace analysis itself.