T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:15
- Finding
- Hardcoded API Credential Exposed in Skill Documentation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15-18` **Vulnerability Type**: Hardcoded secret / exposed API credential **Risk Level**: High ### Vulnerable Code ```bash Set the API key as an environment variable (recommended): export CREWAI_API_KEY="5aZyTFQJAAT03VPIII5zsIPcL8KTtdST" ``` ### Technical Analysis The Skill documentation contains a plaintext, live-looking API key. Because `SKILL.md` is distributed with the Skill, every person or system that can access the package can recover and reuse the credential independently of the helper script. Moving the same hardcoded value into an environment variable does not protect it: the secret is already disclosed in the source file and may also remain accessible through package archives, caches, repository history, audit logs, or copied documentation. The audit did not verify whether the credential remains active. If it is active, an attacker can use it to authenticate directly to the documented CrewAI service. A shared credential also prevents reliable attribution of requests to individual users. ### Attack Path 1. An attacker downloads or otherwise obtains access to the Skill package. 2. The attacker reads `SKILL.md` and extracts the embedded API key. 3. The attacker sends requests directly to the documented service, for example by placing the key in the `X-API-Key` request header. 4. If the key remains valid, the service accepts requests under the credential owner's identity and authorization scope. 5. The attacker consumes available quota, invokes exposed workflows, or performs any other operation permitted to that key until it is revoked or restricted. ### Impact Assessment Successful exploitation does not grant local operating-system privileges. It grants the attacker the remote API privileges assigned to the exposed credential. Potential effects include: - Unauthorized use of the CrewAI service. - Consumption of quotas or paid resources. - Abuse of workflows available to the cre ...[truncated 334 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the disclosed API key immediately; removal from the current file is insufficient once a secret has been distributed. 2. Remove the real credential from `SKILL.md`, package archives, release artifacts, and version-control history where feasible. 3. Replace the example with an unambiguously nonfunctional placeholder: ```bash export CREWAI_API_KEY="YOUR_API_KEY" ``` 4. Require each user or deployment to provision its own credential through a protected environment variable or secret-management system. 5. Use separate credentials per user or workload to support revocation, least privilege, rate limits, and audit attribution. 6. Restrict each key to only the required endpoints and operations. 7. Review server access logs for suspicious use of the exposed key and invalidate related sessions or derived credentials if applicable. 8. Add automated secret scanning to development and release pipelines to prevent future credential publication. ]]>
