T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:165
- Finding
- Plaintext Configuration Change Logging May Expose Sensitive Values<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 165-176 **Vulnerability Type**: Plaintext storage of potentially sensitive configuration values **Risk Level**: Medium ### Vulnerable Code ```markdown Change log format (append to `~/.openclaw/workspace/logs/config-changes.log`): ``` ```text ## YYYY-MM-DDTHH:MM:SS+08:00 - action: add|modify|remove - target: config.key.path - old_value: <previous value or "N/A"> - new_value: <new value> - reason: <brief justification> - schema_verified: true - doc_source: <URL or "QMD:collection/doc-id"> - user_approved: true - backup: <backup file path> ``` ### Technical Analysis The skill requires every configuration change to be recorded in `~/.openclaw/workspace/logs/config-changes.log`, including the complete previous and new values. It does not require secret detection, redaction, restrictive file permissions, or exclusion of sensitive configuration paths. If a modified configuration value contains an API key, authentication token, password, private endpoint credential, or another secret, that value will be duplicated into a persistent plaintext log. Recording both `old_value` and `new_value` can expose current credentials as well as credentials that were rotated because they were suspected of compromise. This expands the sensitive-data footprint beyond `openclaw.json`. Security controls applied to the primary configuration file may not apply to a log under the workspace directory, which may be included in backups, support bundles, repository commits, synchronization systems, or broad workspace access. ### Attack Path 1. A user requests a legitimate change to a secret-bearing configuration value. 2. The skill follows the mandatory logging procedure after applying the change. 3. The complete previous and new secret values are appended to `~/.openclaw/workspace/logs/config-changes.log`. 4. A local user, process, plugin, backup service, or synchronization tool with access to the workspace log reads ...[truncated 877 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Never log raw values from secret-bearing fields. Record only the action, target path, timestamp, approval state, and validation result. 2. Introduce mandatory recursive redaction for fields whose names or schema annotations indicate sensitive content, including tokens, passwords, API keys, secrets, credentials, and private keys. 3. Replace raw values with safe metadata, such as: - `old_value: [REDACTED]` - `new_value: [REDACTED]` - A one-way fingerprint when change correlation is necessary - Type and presence information rather than content 4. Default to redaction when a field's sensitivity is uncertain. 5. Create the log directory and file with restrictive permissions, such as directory mode `0700` and file mode `0600`, and verify ownership before appending. 6. Prevent the log from being committed to source control or included in broadly accessible support bundles and synchronization workflows. 7. Document a retention and secure-deletion policy for historical change records. 8. Update the required log format so that sensitive values cannot be included accidentally, for example: ```text - old_value: [REDACTED] - new_value: [REDACTED] - value_changed: true ``` ]]>
