T09 · Insecure Skill Coding Practices
- Location
modules/auth-methods.md:13- Finding
Insecure Plaintext API Key Storage Guidance
- Content
View full analysis
> ~/.env ``` ### Technical Analysis The documented setup pattern encourages users to place an API key in a generic plaintext file without first creating the file with restrictive permissions. The resulting `~/.env` file inherits permissions determined by the user's current `umask`, which may allow unintended local access. If a user replaces the placeholder with an actual API key directly in the command, the credential may also be retained in shell history. A generic home-directory environment file can additionally be consumed by unrelated tools, included in backups, or copied into source-controlled environments. The credential path identified by the static pre-scan at `modules/auth-methods.md` lines 68–72 is not itself vulnerable. Those lines are comments describing common CLI-managed OAuth token locations and do not instruct the agent to read, modify, or transmit those files. ### Attack Path 1. A user follows the documented example and substitutes a real API key for `your-key-here`. 2. The command containing the key is potentially recorded in the user's shell history. 3. The key is appended to `~/.env` without explicit permission hardening. 4. A local user, process, backup system, or unrelated tool with access to the file or shell history obtains the credential. 5. The exposed key is used to authenticate to the associated external service within the permissions assigned to that key. ### Impact Assessment Successful exploitation exposes the API key and grants the attacker the same service privileges and scope assigned to it. Depending on the provider and key configuration, this could permit unauthorized API requests, access to p ...[truncated 325 chars]- Remediation
View remediation
