T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:214- Finding
KeyAPI Bearer Token Stored in Plaintext Without Enforced Access Controls
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly aligned with Instagram analysis through KeyAPI, but its setup stores a bearer token in shell startup files and handles token entry in ways that deserve review before installation.
Install only if you are comfortable using a KeyAPI token for live Instagram data requests. Prefer a per-session environment variable or a secure credential store instead of the provided persistent setup, avoid passing tokens on the command line, keep follower/story/comment collection narrowly scoped, and delete exported response files when no longer needed.
scripts/configure-keyapi-auth.mjs:214KeyAPI Bearer Token Stored in Plaintext Without Enforced Access Controls
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 guidance explicitly routes the agent to collect Stories, followers/following, and related-profile relationship data without any privacy guardrails, purpose limitation, or sensitivity warning. In a skill designed for live Instagram discovery and analysis, this can normalize collection of relationship and ephemeral content in ways that enable profiling, surveillance, or over-collection beyond user intent.
The file explicitly instructs that API calls are live by default and recommends rerunning requests with an output file to capture full payloads, but it does not require user consent or warn that Instagram-related data may be stored locally or repeatedly transmitted to a third-party API. This can lead to unintended collection, persistence, and disclosure of profile, follower, comment, or location data, especially when the agent handles personal or sensitive targets.
The script prompts for KEYAPI_TOKEN using readline.question(), which reads from standard input without masking the entered value. In a normal terminal this means the token is typically echoed to the screen and may also be exposed to shoulder-surfing, terminal recording, or shell/session logging, unnecessarily disclosing a secret during setup. In this skill context, the script is specifically for API credential configuration, so handling secrets safely is security-relevant rather than incidental.
The script reads KEYAPI_TOKEN from the user's shell profile files (.zshrc, .bashrc, .profile, PowerShell profile) when the environment variable is absent. Accessing unrelated local config files expands the skill's data-access scope beyond simple Instagram API usage and can expose secrets stored in those files without clear user consent. In a skill whose stated purpose is Instagram discovery/analysis, this local secret harvesting capability is broader than necessary.
The script silently reads and uses KEYAPI_TOKEN for authenticated requests, including from managed shell profile content, without any in-file disclosure at point of use. This can cause users or higher-level agents to transmit credentials they did not realize would be consumed by the skill, reducing transparency around secret handling. The risk is amplified because the skill can source the token from persistent profile files rather than only the current session.
Detected: suspicious.env_credential_access, suspicious.secret_argv_exposure