T09 · Insecure Skill Coding Practices
- Location
references/auth-setup.md:5- Finding
Ambiguous Persistent Storage of API Credentials May Expose Live Keys
- Content
View full analysis
Vulnerability Details
File Location:
references/auth-setup.md, lines 5–10 and 27–31
Vulnerability Type: Plaintext credential storage in an unspecified persistent configuration
Risk Level: MediumVulnerable Code Snippet
markdown This guide gets you a StayingAPI key and persists it so it survives across sessions. ## Step 0 — how to store an env var on this system Figure out the correct way to persist an environment variable on this machine so it is available in every future session (a shell profile, or a config/env file managed by your agent runtime). The variable name is `STAYINGAPI_KEY`.markdown ## Step 2 — store it ```bash export STAYINGAPI_KEY="stay_live_…" # or stay_test_… for the sandboxtext ### Technical Analysis The setup guide directs the agent to determine how to persist `STAYINGAPI_KEY` in a shell profile or an agent-runtime configuration file. It does not constrain the destination, require explicit user approval before modifying persistent configuration, prescribe restrictive file permissions, or require an operating-system credential manager or runtime secret store. A live API key stored in plaintext may consequently be written to a shared, broadly readable, backed-up, logged, or version-controlled file. The sample `export` command only configures the current process or shell session by itself, while the preceding persistence instruction implicitly requires an additional file modification whose security properties are left unspecified. This is an insecure credential-handling practice rather than evidence of intentional credential exfiltration. The reviewed files explicitly identify StayingAPI as the API recipient, and no unrelated credential destination was found. ### Attack Path 1. A user invokes the Skill without `STAYINGAPI_KEY` already configured. 2. The Skill follows the setup guide and selects a shell profile or agent-runtime configuration file for persistent storage. 3. A live `stay_live_…` key ...[truncated 1149 chars]- Remediation
View remediation
Remediation Suggestions
- Default to session-scoped credential injection instead of persistent storage.
- If persistence is necessary, request explicit user approval before modifying any shell profile or runtime configuration.
- Prefer an operating-system credential manager, encrypted secret store, or the agent runtime’s designated secrets facility.
- Never place the key in project directories, repository-tracked files, command history, logs, or diagnostic output.
- If a plaintext environment file is unavoidable, store it outside the repository, apply owner-only permissions such as mode
0600, and ensure parent directories are not accessible to unauthorized users. - Add explicit ignore rules and secret-scanning controls to prevent accidental source-control commits.
- Recommend sandbox keys for evaluation and reserve live keys for actual live-data requests.
- Document key rotation and revocation procedures and advise immediate rotation if exposure is suspected.
- Clarify that the displayed
exportcommand is session-scoped and provide separate, platform-specific secure persistence guidance rather than instructing the agent to select an unspecified file.
