T09 · Insecure Skill Coding Practices
- Location
SKILL.md:125- Finding
API Key Persisted in a Plaintext Shell Startup File
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 125
Vulnerability Type: Plaintext sensitive-data storage
Risk Level: Mediumbash # Permanently save the key by adding it to ~/.bashrc or ~/.zshrc echo 'export ZIPTAX_API_KEY="your-api-key-here"' >> ~/.bashrcTechnical Analysis
The Skill recommends persisting the ZipTax API key directly in a shell startup file. When the placeholder is replaced with a real key, the credential is stored as plaintext and automatically loaded into every shell session.
Shell profile files are not dedicated secret stores. They may be exposed through backups, support bundles, accidental repository commits, home-directory sharing, overly permissive file permissions, or unrelated processes operating under the same account. This conflicts with the document's separate recommendation to use secure secret management and exceeds the minimum secret-storage privileges needed to perform tax lookups.
Attack Path
- The user follows the documented command and replaces the placeholder with a valid API key.
- The key is written in plaintext to
~/.bashrc. - An attacker or unrelated local process obtains read access to the file through compromised account access, permissive permissions, backups, or diagnostic collection.
- The attacker extracts the value assigned to
ZIPTAX_API_KEY. - The attacker replays the credential against the ZipTax API.
Impact Assessment
Successful exploitation exposes the user's ZipTax credential. An attacker could submit API requests under the victim's account, consume the free or paid request quota, access account metrics available to that key, and cause service disruption or unexpected charges depending on the account plan.
This does not grant operating-system privilege escalation by itself. Its scope is limited to the permissions and account capabilities associated with the exposed API key.
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to store the key directly in
~/.bashrcor~/.zshrc. - Prefer an operating-system credential store, such as macOS Keychain, Windows Credential Manager, or a Linux secret service.
- For production use, recommend a dedicated secrets manager such as AWS Secrets Manager, HashiCorp Vault, or an equivalent platform service.
- If a configuration file must be supported, store it outside the repository and enforce owner-only permissions, such as mode
0600. - Add instructions for credential rotation and immediate revocation following suspected disclosure.
- Warn users not to include shell profiles or environment dumps in repositories, logs, support bundles, or debugging output.
- Remove the recommendation to store the key directly in
