T09 · Insecure Skill Coding Practices
Warning
- Location
- skill.md:7
- Finding
- API Credential Access Incorrectly Declared as Non-Sensitive<![CDATA[ ## Vulnerability Details **File Location**: `skill.md`, lines 7–20; related credential transmission instructions at lines 31–39 **Vulnerability Type**: Sensitive credential metadata misconfiguration **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: openclaw: emoji: "🚀" requires: env: - EZYHOST_API_KEY primaryEnv: EZYHOST_API_KEY permissions: version: 1 declared_purpose: "Deploy and manage static websites on EzyHost. Upload files, run SEO analysis, track analytics, generate sites with AI, configure custom domains, manage versions, teams, QR codes, and email capture." network: - "ezyhost.io" env: - "EZYHOST_API_KEY" filesystem: [] exec: [] sensitive_data: credentials: false ``` The same file explicitly instructs the agent to use this environment variable as an authentication credential: ```text All API requests require an API key passed as a header: x-api-key: $EZYHOST_API_KEY The key is loaded from the `EZYHOST_API_KEY` environment variable. ``` ### Technical Analysis The Skill requires access to `EZYHOST_API_KEY`, designates it as its primary environment variable, and transmits its value as an HTTP authentication header. Despite this behavior, the permissions metadata declares `sensitive_data.credentials: false`. An API key is credential material regardless of whether it is stored in an environment variable or sent only to the intended service. This contradictory declaration can cause runtimes, security scanners, consent interfaces, or logging systems that rely on the manifest to omit credential-specific safeguards. The file does not contain a hardcoded key or direct evidence that the key is intentionally sent to an unrelated destination. The vulnerability is therefore a security metadata and handling defect rather than confirmed credential theft. ### Attack Path 1. A user installs or invokes the Skill and provides `EZYHOST_API_KE ...[truncated 1403 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Correct the manifest so that credential use is explicitly declared: ```yaml sensitive_data: credentials: true ``` 2. Preserve the existing network allowlist and ensure the API key can be transmitted only to the exact approved HTTPS origin, `https://ezyhost.io`, rather than arbitrary hosts or redirects. 3. Prevent the API key and complete authentication headers from appearing in: - Agent responses - HTTP debug output - Error messages - Telemetry - Execution transcripts - Persistent memory or generated files 4. Apply automatic redaction to `EZYHOST_API_KEY`, `x-api-key`, and equivalent authorization fields. 5. Provide the credential only to the specific request process that needs it instead of exposing it broadly to unrelated tools or subprocesses. 6. Require explicit user confirmation before destructive or security-sensitive operations, including project deletion, bulk file deletion, domain removal, team changes, API-key generation, and API-key revocation. 7. Support immediate key revocation and rotation, and document the response procedure for suspected disclosure. 8. If supported by EzyHost, use scoped, short-lived, or project-specific credentials instead of an account-wide long-lived API key. ]]>
