T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:124- Finding
Bearer Token Persisted in Plaintext Shell Profile
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for Reddit analysis through KeyAPI, but its credential setup stores and reuses an API token from shell profiles in a way users should review before installing.
Install only if you are comfortable using KeyAPI for live Reddit requests and storing a KeyAPI bearer token locally. Prefer a session-only KEYAPI_TOKEN or a dedicated secret manager over the provided shell-profile setup, avoid passing real tokens on the command line, and review any request body or local file before sending it to KeyAPI.
scripts/configure-keyapi-auth.mjs:124Bearer Token Persisted in Plaintext Shell Profile
scripts/configure-keyapi-auth.mjs:193Bearer Token Can Be Exposed Through Echoed Input and Command-Line Arguments
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 skill description and invocation scope are very broad, covering nearly any Reddit-related analysis, search, reporting, or monitoring request. In an agent environment, this can cause the skill to trigger for loosely related prompts and automatically route user data or tasks into live external API workflows without sufficiently precise user intent boundaries, increasing the chance of over-collection, unintended API use, or surprising behavior.
The script prompts for a KEYAPI token and then writes it into the user's shell profile as an environment variable, which persists the secret in plaintext on disk. Although this is framed as convenience setup, shell profiles are broadly readable by local processes under the same user context, may be backed up or synced, and the script does not clearly warn the user that the credential will be stored persistently in plaintext.
The script automatically reads KEYAPI_TOKEN from shell profile files such as .zshrc, .bashrc, .profile, or a PowerShell profile when the environment variable is unset. That expands the skill's access from the current process environment into persistent user configuration files, which is a sensitive local data source and can expose credentials to code the user may not expect to read them.
The code reads credentials from managed shell profile content without any notice, prompt, or disclosure at the point of access. Silent access to profile files is risky because users may assume the skill only uses current-session environment variables, while it is actually harvesting persistent secrets from local initialization files.
The script loads request data from --query, --body, --body-file, and --image-file, then sends it to https://api.keyapi.ai via fetch. This is a network transmission of potentially sensitive user or system data, but the code provides no prompt, disclosure, or warning to the user before sending it.
Detected: suspicious.env_credential_access, suspicious.secret_argv_exposure