T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:127- Finding
KeyAPI Token Is Persisted in Plaintext and May Be Exposed During Entry
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent YouTube KeyAPI purpose, but it needs review because its helpers persist API tokens in shell profiles and can read or overwrite arbitrary user-selected file paths.
Install only if you are comfortable sending YouTube research inputs to KeyAPI and using local helper scripts. Prefer a session-only KEYAPI_TOKEN over writing it to shell profiles, avoid passing tokens on the command line, do not use file-input flags with sensitive files, and choose output paths carefully to avoid overwriting important files.
scripts/configure-keyapi-auth.mjs:127KeyAPI Token Is Persisted in Plaintext and May Be Exposed During Entry
scripts/keyapi-api.mjs:238Unrestricted File Paths Permit Local File Transmission and Arbitrary File Overwrite
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 rule explicitly instructs the agent to save full API responses to local temporary or workspace files for internal analysis, and only suggests cleanup 'when practical' or brief mention if files remain. Because API responses may contain sensitive or user-requested data, this creates unnecessary persistence on disk and raises the risk of unintended exposure through leftover files, workspace sync, logs, or later reuse by other processes.
The skill explicitly states that API calls are live by default, but it does not disclose that user-supplied inputs such as search queries, video URLs, channel handles, topics, or other identifiers will be sent to an external third-party service. This creates a privacy and data-handling transparency gap: users may provide sensitive investigative, business, or personal inputs without realizing they are being transmitted off-platform.
The code detects and edits user shell startup files such as .zshrc, .bashrc, .profile, and PowerShell profiles, giving the skill a persistence mechanism unrelated to its primary YouTube-analysis function. In this skill context, that capability is more dangerous because credential setup can be achieved without altering startup scripts, so profile editing creates unnecessary system-wide side effects and a foothold for persistent environment changes.
The script prompts for KEYAPI_TOKEN using a normal readline question, so the secret may be echoed to the terminal and then stored persistently in a shell profile without an adequate warning. This can expose the token through shoulder-surfing, terminal recording/logging, shell backup/sync tooling, or later inspection of profile files.
The script persistently modifies the user's shell profile to install KEYAPI_TOKEN, which extends its behavior beyond one-time YouTube analysis into long-lived environment modification. Persisting secrets in startup files increases exposure to accidental disclosure, unintended reuse by other processes, and surprises users who may not expect profile mutation from a skill helper.