T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:115- Finding
KeyAPI Token Is Entered Visibly and Persisted in Plaintext Shell Profiles
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is purpose-aligned for KeyAPI Google searches, but its credential setup stores an API token in shell profile files in plaintext without a separate confirmation step.
Review the credential setup before installing. Prefer setting KEYAPI_TOKEN only for the current session or using a dedicated secret store; avoid passing real tokens with --token on the command line, and rotate the token if it may have been exposed in terminal history or a shell profile.
scripts/configure-keyapi-auth.mjs:115KeyAPI Token Is Entered Visibly and Persisted in Plaintext Shell Profiles
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 interactive prompt uses a normal readline question, so the entered API token is echoed to the terminal as the user types. This can expose the secret to shoulder surfing, terminal recording/logging tools, shared session transcripts, or shell history capture in some environments.
The script writes KEYAPI_TOKEN into the user's shell profile, causing long-lived credential persistence outside the immediate task of making API requests. This increases exposure because any future shell session, local process, backup, or accidental profile sharing can reveal or misuse the token, and it exceeds the narrow search/extraction purpose of the skill.
The script persists KEYAPI_TOKEN into the detected shell profile immediately, without an explicit confirmation step identifying the file and the consequence of storing a secret in plaintext. This creates risk of unintended credential exposure and unexpected modification of user environment files, especially because profile files are commonly synced, backed up, or inspected by other tools.
The script reads KEYAPI_TOKEN not only from the current process environment but also from the user's shell profile file by locating and parsing a managed block. Accessing local credential material from profile files expands the skill's data-access scope beyond making API calls and creates a path for unintended secret harvesting or exfiltration if the script or surrounding agent behavior is abused.
The --output-file argument allows the caller to write full API responses to any filesystem path, with parent directories created automatically. In an agent setting, arbitrary file write can be abused to place sensitive data in unintended locations, overwrite user files, or persist data where other tools or processes may later consume it.
Detected: suspicious.env_credential_access, suspicious.secret_argv_exposure