T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:10
- Finding
- Excessive Declaration of Sensitive AI Provider Credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 10-19 **Vulnerability Type**: Excessive secret exposure through insecure configuration **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: openclaw: requires: env: - OPENAI_API_KEY - ANTHROPIC_API_KEY - GOOGLE_GENERATIVE_AI_API_KEY bins: - node primaryEnv: OPENAI_API_KEY ``` ### Technical Analysis The Skill declares all three AI-provider API keys as required environment variables. This conflicts with `SKILL.md` lines 51-52, which state that only one provider key is necessary because the assistant automatically selects an available provider. Requiring credentials for every supported provider violates least-secret and least-privilege principles. A Skill runtime may make all declared variables available to the Skill process, unnecessarily placing multiple valuable credentials within the same trust boundary. The reviewed artifact also contains no executable implementation that uses these credentials, making their declaration unjustified by the packaged functionality. No credential-reading or exfiltration code was present in the audited files. Consequently, this finding identifies unnecessary credential exposure rather than confirmed credential theft. ### Attack Path 1. An operator installs or loads the Skill. 2. Based on the `requires.env` declaration, the runtime requests or provides all three AI-provider credentials. 3. The credentials become accessible within the Skill execution environment. 4. A compromised dependency, future implementation, or omitted externally supplied server component running in that environment could read every exposed credential. 5. The affected credentials could then be used against their respective provider accounts, subject to each key's configured permissions and quotas. ### Impact Assessment The exposed scope is limited to the permissions associated with the supplied OpenAI, Anthropic, and ...[truncated 417 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not declare all provider credentials as mandatory. 2. Request only the credential corresponding to the explicitly selected `AI_PROVIDER`. 3. If automatic provider selection must remain supported, represent provider keys as optional alternatives rather than simultaneous requirements. 4. Remove all credential requirements if the package remains documentation-only. 5. Ensure credentials are injected only into the process that needs them and are never logged, persisted, returned in errors, or inherited by unrelated child processes. 6. Apply provider-side restrictions, spending limits, monitoring, and key rotation. 7. Add automated tests verifying that selecting one provider does not expose credentials for the other providers. ]]>
