T09 · Insecure Skill Coding Practices
- Location
references/auth-setup.md:5- Finding
Persistent Plaintext Storage of StayingAPI Credentials
- Content
View full analysis
Vulnerability Details
File Location:
references/auth-setup.md, lines 5-8 and 28-30
Vulnerability Type: Persistent plaintext secret exposure
Risk Level: LowRelevant 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`.bash export STAYINGAPI_KEY="stay_live_…" # or stay_test_… for the sandboxTechnical Analysis
The authentication guide directs users to persist the API credential in a shell profile or configuration/environment file and demonstrates exporting the credential as an environment variable. Shell profiles and ordinary environment files commonly store values in plaintext. The guide does not require restrictive file permissions, recommend an operating-system keychain or secret manager, or limit credential injection to the process that needs it.
When placed in a global shell profile,
STAYINGAPI_KEYmay be inherited by every descendant process launched from future shell sessions. Local programs, plugins, build scripts, diagnostic tools, crash handlers, or compromised processes operating under the same user account could inspect the inherited environment. If the profile or environment file has overly broad permissions, another local account may also be able to read the credential directly.Attack Path
- The user follows the guide and adds
export STAYINGAPI_KEY="stay_live_…"to a persistent shell profile or plaintext environment file. - The credential is automatically loaded into future sessions and inherited by child processes, or remains directly readable from the storage file.
- A malicious or compromised process running in the u ...[truncated 1140 chars]
- The user follows the guide and adds
- Remediation
View remediation
Remediation Suggestions
- Prefer an operating-system keychain, dedicated secret manager, or the Agent runtime's protected credential store instead of a shell profile.
- Inject
STAYINGAPI_KEYonly into the process that requires it rather than exporting it globally to all future sessions and child processes. - If file-based storage is unavoidable, use a dedicated file outside the repository, restrict it to the owning user with permissions such as
0600, and ensure it is excluded from source control, logs, backups, and diagnostic bundles where appropriate. - Avoid displaying the credential in shell history, command traces, logs, error messages, or process arguments.
- Document how users can revoke and rotate a potentially exposed key through the StayingAPI dashboard.
- Clearly distinguish sandbox credentials from live credentials and recommend sandbox keys for development and testing.
- Add guidance for periodically reviewing and rotating live credentials and for immediately revoking them after suspected disclosure.
