T09 · Insecure Skill Coding Practices
- Location
scripts/configure-keyapi-auth.mjs:193- Finding
Bearer Token Is Collected and Persisted Insecurely in Plaintext
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill fits its Pinterest API purpose, but its credential persistence and broad helper file/API options deserve user review before installation.
Install only if you are comfortable with a KeyAPI token being stored in a shell profile as plaintext and with the helper scripts making live KeyAPI requests. Prefer setting KEYAPI_TOKEN only for the current shell session, avoid passing tokens in command arguments, do not let untrusted prompts choose --profile, --body-file, --image-file, or --output-file paths, and review generated commands before running them.
scripts/configure-keyapi-auth.mjs:193Bearer Token Is Collected and Persisted Insecurely in Plaintext
scripts/configure-keyapi-auth.mjs:46Arbitrary Caller-Selected File Modification Through the Profile Option
scripts/keyapi-api.mjs:347API Output Can Overwrite Arbitrary User-Writable Files
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 script writes a bearer token into the user's shell profile for persistent reuse, but it does so immediately after input collection without an explicit confirmation step before modifying a startup file. Persisting secrets in profile files increases exposure to accidental disclosure through backups, dotfile sync, local file reads, or later inspection, and automatic shell startup loading broadens the blast radius if the host is shared or compromised.
The presence of --image-file and --image-field support enables construction of base64 image upload payloads, which is inconsistent with a skill described only for discovery and analysis of Pinterest data. This hidden capability broadens the action surface and could let an agent submit content or invoke undocumented image-processing endpoints under the guise of a read-only tool.
The script allows callers to supply arbitrary HTTP methods and JSON bodies, so it can perform write/delete actions against the KeyAPI Pinterest backend rather than being limited to read-only discovery. That exceeds the stated skill purpose and creates a capability mismatch: a user or upstream agent expecting passive analysis could be induced to modify data or trigger side effects through this wrapper.
The manifest describes Pinterest data discovery and analysis, but this code inspects local shell profile files such as .zshrc, .bashrc, .profile, or PowerShell profile files to extract KEYAPI_TOKEN. While credential lookup may be convenient implementation support, reading arbitrary profile files is not part of the user-facing stated purpose of the skill.
Detected: suspicious.env_credential_access, suspicious.secret_argv_exposure