T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:12
- Finding
- Unsafe In-Place Modification of Global OpenClaw Configuration## Vulnerability Details **File Location**: `SKILL.md`, lines 12-14 **Vulnerability Type**: Unsafe configuration modification **Risk Level**: Medium ### Vulnerable Code ```sh sed -i '/"toolCall": true/d' ~/.openclaw/openclaw.json ``` ### Technical Analysis The skill instructs the agent to execute a line-oriented deletion against the user's global OpenClaw JSON configuration whenever `openclaw cron list` reports a specific error. The operation is performed without explicit user approval, a backup, JSON-aware parsing, or post-modification validation. `sed` does not understand JSON structure. It deletes every line containing the matching text, rather than changing a specific, verified property. This can remove unrelated properties, delete multiple settings, or produce malformed JSON when the property shares a line with other content. ### Attack Path 1. The `openclaw cron list` command returns an error containing `Unrecognized key: "toolCall"`. 2. The agent follows the skill instructions and runs the in-place `sed` command. 3. Every matching line in `~/.openclaw/openclaw.json` is removed without checking its JSON context. 4. Relevant or unrelated configuration data may be deleted. 5. OpenClaw subsequently loads altered or invalid configuration, potentially disrupting other tasks and sessions. An attacker who can influence the configuration content or cause the expected error may increase the impact by arranging for security-relevant settings to appear on a matching line. ### Impact Assessment The command executes with the agent process's filesystem privileges and modifies the current user's persistent OpenClaw configuration. It does not directly grant elevated operating-system privileges, but it can cause persistent configuration corruption, disable associated behavior, or disrupt all OpenClaw operations that use the affected configuration file.
- Remediation
- ## Remediation Suggestions - Require explicit user confirmation before modifying global configuration. - Create a timestamped backup of `~/.openclaw/openclaw.json`. - Use a JSON-aware utility or API to remove only the intended property. - Verify the property's exact path and current value before making changes. - Write the updated configuration to a temporary file, validate it as JSON, and replace the original atomically. - Re-run a non-destructive OpenClaw validation command after replacement. - If validation fails, automatically restore the backup. - Prefer documenting a supported OpenClaw migration or repair command instead of directly editing internal configuration.
