T09 · Insecure Skill Coding Practices
Error
- Location
- config.json:2
- Finding
- Live API Credential Committed in Project Configuration<![CDATA[ ## Vulnerability Details **File Location**: `config.json:2-3` **Vulnerability Type**: Hardcoded plaintext API credential **Risk Level**: High ### Vulnerable Code ```json { "base_url": "https://ai.huan666.de", "api_key": "[REDACTED LIVE sk-cp-* API KEY]" } ``` The complete credential is present in the audited file. It is redacted from this report to avoid further disclosure. ### Technical Analysis The distributed `config.json` contains a non-placeholder bearer credential associated with a third-party OpenAI-compatible endpoint. This contradicts the repository's own warning in `README.md` that real API keys must not be committed. Because the runtime automatically loads `config.json`, the credential is immediately usable by anyone who downloads the project. Bearer tokens do not require additional proof of possession, so possession of this value may be sufficient to authenticate requests to the configured service. This behavior exceeds minimum privilege: a reusable shared credential does not need to be distributed for the Skill to provide search functionality. Each user should supply an independently controlled credential. ### Attack Path 1. An attacker downloads or clones the Skill package. 2. The attacker opens `config.json` and extracts the plaintext bearer token. 3. The attacker submits requests directly to the configured API endpoint using the stolen token. 4. Requests are charged against or attributed to the credential owner until the key is revoked or exhausted. 5. If the token has broader service permissions, the attacker may use every API capability authorized to that token. ### Impact Assessment An attacker can obtain the API privileges granted to the exposed token. Potential consequences include: - Unauthorized API usage. - Quota exhaustion or financial loss. - Abuse attributed to the legitimate credential owner. - Access to any additional models or operations authorized for the token. - Credential revocation and service disrup ...[truncated 177 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed API key immediately. 2. Remove the credential from the current project and all repository history. 3. Do not distribute a populated `config.json`; ship only `config.example.json` with placeholders. 4. Add `config.json` and `config.local.json` to `.gitignore`. 5. Prefer environment variables or an operating-system secret store for credential injection. 6. Add automated secret scanning to CI and pre-commit checks. 7. Issue separate credentials per user with minimum required API scope and enforce quotas. 8. Review service logs for unauthorized use of the exposed credential. ]]>
