T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:48
- Finding
- Plaintext Storage of Exchange API Credentials## Vulnerability Details **File Location**: `SKILL.md`, line 48 **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: High **Complete Vulnerable Snippet**: ```text 2. Edit `config.json` and enter your API Key. ``` The snippet above is an English rendering of the instruction at line 48, which directs users to place an API key in `config.json`. ### Technical Analysis The deployment instructions direct users to store cryptocurrency exchange API credentials in a plaintext JSON configuration file. No corresponding controls are documented for: - Excluding `config.json` from version control. - Restricting filesystem permissions. - Loading credentials from environment variables or a secret manager. - Limiting the API key to trading-only permissions. - Disabling withdrawal permissions. - Applying an exchange-side IP allowlist. - Preventing credentials from appearing in backups or support archives. A plaintext configuration file can be exposed through an accidental source-control commit, shared project archive, cloud backup, overly permissive filesystem access, or local system compromise. The repository does not include the referenced `config.json` or application source, so runtime handling of the credential could not be verified. ### Attack Path 1. A user follows the deployment instructions and writes an exchange API key into `config.json`. 2. The configuration file is accidentally committed, archived, backed up, shared, or read by another local process or user. 3. An attacker extracts the API key and any associated secret from the file. 4. The attacker authenticates to the relevant exchange API. 5. The attacker performs actions allowed by the key, potentially including account-data access or unauthorized trades. Withdrawal is possible only if the exposed key was independently granted withdrawal permission. ### Impact Assessment The maximum impact is bounded by the permissions assigned ...[truncated 326 chars]
- Remediation
- ## Remediation Suggestions - Load credentials from environment variables or a dedicated secret manager rather than a tracked JSON file. - Provide a sanitized `config.example.json` containing placeholders only. - Add `config.json`, `.env`, and other secret-bearing files to `.gitignore`. - Validate at startup that placeholder or empty credentials are not accepted. - Restrict secret-file permissions to the service account, such as mode `0600` on supported systems. - Require exchange API keys to use least privilege, with withdrawal permissions disabled. - Recommend exchange-side IP allowlisting and separate keys for development and production. - Document credential rotation and immediate revocation procedures. - Ensure secrets are redacted from logs, exceptions, diagnostics, backups, and Telegram alerts.
