T09 · Insecure Skill Coding Practices
Error
- Location
- config.json:2
- Finding
- Production Credentials Stored in Plaintext Configuration<![CDATA[ ## Vulnerability Details **File Location**: `config.json:2-5` **Vulnerability Type**: Hardcoded secrets and plaintext credentials **Risk Level**: High ### Vulnerable Code ```json { "nvidia_api_key": "[REDACTED — production-looking NVIDIA API key]", "postiz_api_key": "[REDACTED — production-looking Postiz API key]", "postiz_email": "alexander@krueger.vip", "postiz_password": "[REDACTED — plaintext Postiz password]", "postiz_base_url": "http://localhost:4007/api" } ``` The secret values have been redacted from this report to avoid further credential disclosure. The audited file contains the complete plaintext values. ### Technical Analysis The distributed `config.json` contains a production-looking NVIDIA API key, a Postiz API token, a Postiz account email address, and a plaintext Postiz password. These values are directly usable application credentials rather than documented placeholders. Any person or process with read access to the project directory, source archive, backup, build artifact, or repository history can recover these credentials. Secret exposure is especially serious for Postiz because the account may have access to connected TikTok publishing integrations. The example configuration also promotes storing all credentials in a regular JSON file: ```json { "nvidia_api_key": "nvapi-YOUR_KEY_HERE", "postiz_api_key": "YOUR_POSTIZ_API_KEY", "postiz_email": "you@example.com", "postiz_password": "your_postiz_password" } ``` This design does not provide encryption, access isolation, automatic rotation, or protection against accidental source-control commits. ### Attack Path 1. An attacker downloads the Skill package, obtains a repository clone, reads a backup, or gains local read access to the project. 2. The attacker opens `config.json` and extracts the NVIDIA API key, Postiz API token, email address, and password. 3. The attacker uses the NVIDIA key to consume API resources. 4. The attacker uses the Postiz token or a ...[truncated 882 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate the exposed NVIDIA key, Postiz API key, and Postiz password. 2. Remove `config.json` from all distributed packages and source-control history. 3. Add `config.json` and other secret-bearing files to `.gitignore`. 4. Retain only a placeholder-only `config.example.json`. 5. Load secrets from environment variables, an operating-system credential store, or a dedicated secret manager. 6. Avoid retaining the Postiz account password when a narrowly scoped API token can perform the required operations. 7. Restrict token permissions to only media upload, draft creation, and analytics retrieval where supported. 8. Apply restrictive file permissions, such as `0600`, to any unavoidable local secret file. 9. Add automated secret scanning to pre-commit hooks and CI pipelines. 10. Review repository history, release archives, logs, and backups for copies of the exposed values. ]]>
