T09 · Insecure Skill Coding Practices
- Location
scripts/valyu.mjs:45- Finding
Valyu API key is accepted through command-line arguments and stored without enforced restrictive permissions
- Content
View full analysis
' }, null, 2)); process.exit(1); } try { saveApiKey(apiKey); ``` When no key is configured, the script encourages sharing the credential with the agent: ```javascript message: "I need your Valyu API key to proceed. You can get one at https://platform.valyu.ai — once you have it, just share it with me and I'll set it up for you." ``` ### Technical Analysis The API key is written in plaintext to `~/.valyu/config.json` using `writeFileSync` without an explicit restrictive mode. For newly created files, effective permissions therefore depend on the process umask. In environments with a permissive umask, the file can be readable by other local users. If the file already exists with overly broad permissions, rewriting it does not correct those permissions. The key is also supplied as `scripts/valyu setup `. Command-line secrets may be exposed through shell history, process inspection where permitted, agent command transcripts, execution logs, or monitoring systems that record arguments. Asking the user to share the key in conversation can additiona ...[truncated 1545 chars]- Remediation
View remediation
