T09 · Insecure Skill Coding Practices
Warning
- Location
- README.md:41
- Finding
- API Key Stored in Plaintext Configuration## Vulnerability Details **File Location**: `README.md:41-49` **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: Medium ### Vulnerable Code ```json { "skills": { "entries": { "unione": { "enabled": true, "apiKey": "YOUR_UNIONE_API_KEY" } } } } ``` ### Technical Analysis The installation documentation recommends placing the UniOne API key directly in `~/.openclaw/openclaw.json`. If a user replaces the placeholder as instructed, the credential is stored as plaintext in a persistent configuration file. Plaintext credentials may be exposed to other local users or processes with file-read access, endpoint backup systems, diagnostic bundles, configuration synchronization services, or accidental source-control commits. Although `SKILL.md` instructs the agent not to log or display the key, that safeguard does not protect a credential written to disk. The API key is transmitted to `https://api.unione.io` through the `X-API-KEY` header. This authenticated HTTPS transmission is necessary for the Skill’s declared functionality, and no transmission of the key to an unrelated host was identified. The security issue is the documented persistent storage method rather than the authenticated API request itself. ### Attack Path 1. A user follows the README configuration instructions and replaces `YOUR_UNIONE_API_KEY` with a valid UniOne API key. 2. The valid key is saved in plaintext inside `~/.openclaw/openclaw.json`. 3. A local process, another user with sufficient file access, an exposed backup, a diagnostic collector, or an accidentally published configuration copy obtains the file. 4. The attacker extracts the API key and sends authenticated requests to the UniOne API. 5. Subject to the permissions associated with that key, the attacker can use the documented account-management and email-delivery endpoints. ### Impact Assessment Compromise of ...[truncated 1049 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the recommendation to place the API key directly in `openclaw.json`. 2. Make the documented `UNIONE_API_KEY` environment-variable method the default configuration approach. 3. Prefer an operating-system credential store or dedicated secret manager over persistent plaintext environment configuration where supported. 4. If file-based storage is unavoidable: - Store the secret in a separate, excluded secrets file. - Restrict ownership to the intended account. - Set permissions so only that account can read the file, such as mode `0600` on Unix-like systems. - Explicitly exclude the file from source control, backups, support bundles, and synchronization services where appropriate. 5. Recommend separate, least-privilege API keys for different projects or environments rather than one broadly privileged account key. 6. Document key rotation and immediate revocation procedures for suspected exposure. 7. Add secret-scanning guidance and warn users never to paste real API keys into chat messages, logs, issue reports, or committed configuration. 8. Retain the existing requirement to use only `api.unione.io` for authenticated requests and never display or log the full key.
