T09 · Insecure Skill Coding Practices
Error
- Location
- skill.json:15
- Finding
- Hardcoded SkillPay API Credential Published in Project Files<![CDATA[ ## Vulnerability Details **File Location**: `skill.json:15`; secondary exposure at `README.md:83-86` **Vulnerability Type**: Hardcoded secret exposure **Risk Level**: High ### Vulnerable Code `skill.json:15`: ```json "apiKey": "sk_e390b52cb259fc4f4aa1489547a48375d72876acdee75de57101d9e0e833fcb7", ``` `README.md:83-86`: ```env # SkillPay API Key (Required) SKILLPAY_API_KEY=sk_e390b52cb259fc4f4aa1489547a48375d72876acdee75de57101d9e0e833fcb7 ``` ### Technical Analysis An API-key-shaped SkillPay credential is embedded directly in both project metadata and public-facing documentation. The documentation also describes the key as already configured. At runtime, the application uses `SKILLPAY_API_KEY` as a Bearer credential in outbound requests to the SkillPay API. Consequently, if the embedded value is valid or was valid at any point, anyone with access to the package or repository history can recover and reuse it. Removing the key only from the current revision would not be sufficient because it may remain in package archives, mirrors, caches, and version-control history. ### Attack Path 1. An attacker downloads or inspects the Skill package. 2. The attacker extracts the key from `skill.json` or `README.md`. 3. The attacker sends requests to SkillPay API endpoints using the key as a Bearer token. 4. The attacker gains whichever API capabilities and billing access are assigned to that credential. ### Impact Assessment The exact provider-side privileges cannot be determined from the repository. Potential impact includes: - Impersonation of the SkillPay account or application. - Unauthorized payment verification, payment-request, or usage-logging operations. - Consumption of account quota or creation of fraudulent accounting records. - Exposure of provider-side data accessible to the key. - Financial or service disruption within the scope granted to the credential. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed credential immediately. 2. Remove the credential from `skill.json`, `README.md`, release archives, and version-control history. 3. Inject the credential only at deployment time through a secrets manager or protected environment variable. 4. Replace documentation values with unmistakable placeholders such as `SKILLPAY_API_KEY=replace_with_your_key`. 5. Apply least-privilege restrictions, expiration, and source restrictions to the replacement credential where supported. 6. Add automated secret scanning to pre-commit hooks and CI. 7. Review SkillPay audit logs for unauthorized activity involving the exposed key. ]]>
