T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Unsafe In-Place Modification of Global OpenClaw Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-14
Vulnerability Type: Unsafe configuration modification
Risk Level: MediumVulnerable Code
sh sed -i '/"toolCall": true/d' ~/.openclaw/openclaw.jsonTechnical Analysis
The skill instructs the agent to execute a line-oriented deletion against the user's global OpenClaw JSON configuration whenever
openclaw cron listreports a specific error. The operation is performed without explicit user approval, a backup, JSON-aware parsing, or post-modification validation.seddoes 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
- The
openclaw cron listcommand returns an error containingUnrecognized key: "toolCall". - The agent follows the skill instructions and runs the in-place
sedcommand. - Every matching line in
~/.openclaw/openclaw.jsonis removed without checking its JSON context. - Relevant or unrelated configuration data may be deleted.
- 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.
- The
- Remediation
View 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.
