T09 · Insecure Skill Coding Practices
- Location
SKILL.md:15- Finding
Recovery Credentials Directed to Insecure Persistent Storage
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 15–26
Vulnerability Type: Plaintext storage of sensitive credentials
Risk Level: MediumVulnerable Code Snippet
markdown - Store `api_key` AND `claim_token` durably the moment you receive them (e.g. `~/.config/apexapi/credentials.json`). The claim token is the only recovery path.markdown Response 201 gives `api_key` (ak-…), `claim_token`, and `fund_url`. **Save all three immediately.** Rate limit: 10 registrations/IP/day. Unfunded accounts are deleted after ~30 days; funded accounts never expire. A human claiming the account is optional.Technical Analysis
The Skill instructs the Agent to persist both an API key and an account-recovery claim token, suggesting a JSON file under the user's home directory. Persistent storage is reasonably related to the declared functionality, but the guidance does not require encryption, an operating-system credential store, restrictive directory and file permissions, or credential lifecycle controls.
The claim token is explicitly described as the only recovery path, making it particularly sensitive. Storing it beside the active API key creates a single point of compromise: any process or user able to read the file may acquire both service access and account-recovery material. The instruction to save the funding URL also retains more account-related data than is necessary for routine authenticated API calls.
This does not grant additional operating-system privileges by itself. The exposed scope is primarily the ApexApi account, its prepaid balance, API usage, and potentially account recovery or claiming capabilities supported by the service.
Attack Path
- The Agent registers an ApexApi account and receives an
api_key,claim_token, andfund_url. - Following the Skill instructions, it writes those values to
~/.config/apexapi/credentials.json. - The file is created with default or ot ...[truncated 1083 chars]
- The Agent registers an ApexApi account and receives an
- Remediation
View remediation
Remediation Suggestions
- Store the API key and claim token in an operating-system keychain, hardware-backed credential store, or established secret-management service.
- If file storage is unavoidable, create the containing directory with mode
0700and the credential file with mode0600; do not rely on the user's defaultumask. - Encrypt secrets at rest using a key that is not stored beside the encrypted file.
- Store the claim token separately from the routinely used API key to reduce the chance that one disclosure compromises both service access and recovery.
- Do not persist the funding URL unless it is operationally required.
- Prevent credentials from entering source control, logs, chat messages, crash reports, telemetry, shell history, or backups.
- Document credential rotation, revocation, recovery, and secure deletion procedures.
- Recommend a restricted API key with explicit spend caps and model or feature allowlists wherever the service supports them.
