T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:123- Finding
Bearer Token Exposed Through Plaintext Shell-Profile Storage and Insecure Input Methods
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for KeyAPI-based Twitter/X analysis, but its credential setup stores an API token persistently in shell profile files with weak secret handling.
Install only if you are comfortable with KeyAPI receiving your Twitter/X queries and with the setup script persisting KEYAPI_TOKEN in a shell profile. Prefer setting KEYAPI_TOKEN only for the current session or using a dedicated secret manager, and avoid passing real tokens with --token on the command line.
scripts/configure-keyapi-auth.mjs:123Bearer Token Exposed Through Plaintext Shell-Profile Storage and Insecure Input Methods
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 explicitly instructs the agent that API calls are 'live by default' and may be repeated, but it does not require a clear user warning or confirmation before transmitting user-supplied Twitter/X identifiers, queries, or other potentially sensitive inputs to an external service. This creates a data-handling and consent risk because users may believe analysis is local when the agent is actually sending data to KeyAPI and retrieving third-party content.
The script stores the API token in plaintext in shell startup files, making the secret persist broadly across future shells and potentially exposing it to other local users, backups, dotfile sync tools, or accidental sharing. For a skill whose main purpose is Twitter/X analysis, persistent profile modification is not strictly necessary and increases the blast radius of a compromised or mishandled token.
The token is collected using readline.question, which echoes input to the terminal by default, so the secret can be exposed on screen, captured in terminal recordings, shoulder-surfed, or preserved in session logs. Secrets should never be entered through a visible prompt unless the user is explicitly warned and given a safer method.
The manifest describes a skill for analyzing Twitter/X content through the KeyAPI REST API, which implies API interaction for retrieval/analysis. This script instead modifies the user's shell profile to persistently store credentials, a behavior not reflected in the manifest description and materially broader than content analysis itself.
The script accepts arbitrary --path/--endpoint and --method values and only constrains them to the /v1/twitter namespace, which enables broad invocation of KeyAPI Twitter endpoints rather than a narrowly scoped analysis-only surface. In an agent skill context, this expands capability beyond the manifest’s stated purpose and can allow unintended data access or state-changing requests if the backing API supports them.