Back to skill

Security audit

Config Modification Safety

Security checks for vulnerabilities and agentic risk

Overview

The skill has a reasonable config-protection purpose, but it installs or documents persistent background changes and rollback behavior with unsafe uninstall and incomplete platform support.

Review carefully before installing. The concept is useful, but this package should be fixed to include all referenced installer assets, require explicit consent before enabling background jobs, safely remove only its own cron entry, protect backup permissions, and make rollback behavior more precise and clearly disclosed.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install.sh:51
Finding

Uninstall command deletes the user's entire crontab

Content
View full analysis
Remediation
View remediation
/dev/null | grep -Fv "$HOME/.openclaw/workspace/.lib/config-safety/health-check.sh" \ > "$TMP_FILE" crontab "$TMP_FILE" rm -f "$TMP_FILE" ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/guard.py:34
Finding

Sensitive configuration backups are created without explicit restrictive permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/guard.py:58
Finding

Rollback restores an unrelated configuration file from an independently selected backup

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/health-check.sh:15
Finding

Gateway health check treats HTTP error responses as healthy

Content
View full analysis
/dev/null 2>&1 return $? } ``` ### Technical Analysis By default, `curl` can exit successfully when the server returns an HTTP error status such as 404, 401, or 500. The script checks only curl's process exit code and discards both status and response body. As a result, any reachable HTTP service at the selected endpoint may be classified as a healthy Gateway. The optional `GATEWAY_URL` environment variable also permits a different endpoint, but the script does not constrain or validate it. There is no external payload execution, but the recovery decision is based on insufficient evidence. ### Attack Path 1. The Gateway becomes unhealthy but continues returning an HTTP response with an error status. 2. Alternatively, another local service responds on the configured host and port. 3. `curl` successfully completes the HTTP exchange and returns exit status zero. 4. `check_health()` reports success. 5. The script exits without invoking rollback or Gateway recovery. ### Impact Assessment The flaw undermines the advertised automatic recovery mechanism. It can leave the Gateway unavailable or malfunctioning while logs report it as healthy. The direct impact is availability and monitoring integrity; it does not grant additional system privileges. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/install.sh:13
Finding

Installers reference missing components and can leave a partial installation

Content
View full analysis
"$PLIST_DST" launchctl load "$PLIST_DST" 2>/dev/null || echo " (可能已加载,跳过)" ``` The project inventory contains no `scripts/com.openclaw.config-guard.plist`. The Windows documentation also instructs users to run or deploy the following absent files: ```text install.bat config-guard.ps1 health-check.ps1 ``` ### Technical Analysis The shell installer uses `set -e` and copies files before attempting to process the missing launchd plist. It therefore terminates after making filesystem changes, leaving a partial deployment. The Windows instructions cannot be completed because the stated installer and PowerShell components are not included. The documentation asks Windows users to run the absent installer as administrator. Because no corresponding implementation is available for review, that elevation is not demonstrated to be necessary. This is not evidence that hidden elevated code executes; rather, the delivered package does not implement its documented behavior. ### Attack Path 1. A macOS user runs `scripts/install.sh`. 2. The script creates the work directory and copies executable guard components. 3. `sed` attempts to read the nonexistent p ...[truncated 711 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/install.sh:32
Finding

Cron installation rewrites the entire user crontab using a broad substring filter

Content
View full analysis
> $HOME/.openclaw/workspace/.lib/config-safety/health-check.log 2>&1" # 读取现有 crontab,移除旧的任务(避免重复) (crontab -l 2>/dev/null | grep -v "config-safety/health-check"; echo "$CRON_LINE") | crontab - ``` ### Technical Analysis The installer reconstructs and replaces the user's complete crontab. It removes every line containing the broad substring `config-safety/health-check`, not only the exact job managed by this Skill. Errors from `crontab -l` are suppressed and treated similarly to an empty crontab. If reading the existing crontab fails for a reason other than no crontab being present, the pipeline may install only the new health-check entry and discard the prior schedule. Persistent scheduling is consistent with the declared recurring health-check functionality, and the job is user-scoped. However, replacing the entire crontab and broadly filtering entries exceeds the minimum scope needed to register one job. ### Attack Path 1. The user already has one or more cron tasks. 2. An unrelated line contains the matching substring, or reading the existing crontab fails. 3. The installation pipeline removes that line or loses the unread crontab contents. 4. The reconstructed crontab is installed. 5. The unrelated scheduled job no longer executes. ### Impact Assessment The modification is limited to the invoking user's crontab. It can disable unrelated scheduled tasks and affect availability, backups, monitoring, or maintenance. It does not directly create elevated privileges or modify system-wide cron configuration. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A second independent description-behavior mismatch reiterates unsupported claims about periodic Gateway health monitoring, auto-recovery, and Windows support. In a safety-oriented skill, overstating recovery guarantees is especially risky because the skill's entire purpose is to prevent system breakage after configuration edits.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A second independent description-behavior mismatch reiterates unsupported claims about periodic Gateway health monitoring, auto-recovery, and Windows support. In a safety-oriented skill, overstating recovery guarantees is especially risky because the skill's entire purpose is to prevent system breakage after configuration edits.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 74)May include surrounding context.

schtasks /query /tn "OpenClaw"

卸载两个守护任务

schtasks /delete /tn "OpenClaw Config Guard" /f schtasks /delete /tn "OpenClaw Health Check" /f

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 75)May include surrounding context.

schtasks /query /tn "OpenClaw"

卸载两个守护任务

schtasks /delete /tn "OpenClaw Config Guard" /f schtasks /delete /tn "OpenClaw Health Check" /f

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · windows/SKILL.md (reported line 58)May include surrounding context.

schtasks /query /tn "OpenClaw"

卸载两个守护任务

schtasks /delete /tn "OpenClaw Config Guard" /f schtasks /delete /tn "OpenClaw Health Check" /f

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · windows/SKILL.md (reported line 59)May include surrounding context.

schtasks /query /tn "OpenClaw"

卸载两个守护任务

schtasks /delete /tn "OpenClaw Config Guard" /f schtasks /delete /tn "OpenClaw Health Check" /f

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs users to run shell scripts and configuration-changing commands but does not declare any tool scope or permissions. That omission reduces transparency and reviewability, making it easier for a consuming agent or user to invoke file-writing and shell behaviors without clear upfront consent boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill promotes fully automatic rollback and recovery without clearly warning that user configuration changes may be overwritten. Automatic reversion of config state can cause loss of intended edits, confusion during troubleshooting, and repeated rollback loops if users are unaware of the mechanism.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

卸载

launchctl unload ~/Library/LaunchAgents/com.openclaw.config-guard.plist crontab -e # 删除 config-safety 那行

text

### Windows(命令提示符 / PowerShell)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script performs a potentially destructive recovery action by invoking a rollback command when health checks fail. Although there are log messages, they do not clearly disclose the impact of the rollback ahead of time to a user, and there is no confirmation prompt or prominent warning comment explaining that the script may automatically revert state.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

This finding identifies the installer section that deploys a launchd plist, which is part of establishing persistence. User-level launchd agents automatically restart or re-run code across sessions, which is security-sensitive in a skill because it extends code execution beyond the immediate install action.

Content

Scanner excerpt · scripts/install.sh (reported line 20)May include surrounding context.

sh
cp "$HOME/.openclaw/skills/config-modification-safety/scripts/health-check.sh" "$WORK_DIR/"
chmod +x "$WORK_DIR/health-check.sh"

# 2. 部署 launchd plist(第一层守护)
echo "🚀 注册第一层守护(launchd WatchPaths)..."
PLIST_SRC="$HOME/.openclaw/skills/config-modification-safety/scripts/com.openclaw.config-guard.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill supports both macOS and Windows, but this installer only configures macOS-style mechanisms: a LaunchAgents plist under ~/Library/LaunchAgents and a crontab entry. There is no Windows installation path, service registration, or Task Scheduler logic here, so the described cross-platform support is not reflected in the actual code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script installs persistent execution via LaunchAgents and crontab, altering the user's startup behavior and scheduled tasks without an explicit consent prompt or a prominent warning before making those changes. Persistent autorun is security-sensitive because it survives the current session and can continue executing code from the skill directory, increasing blast radius if the installed scripts are modified later.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The use of a plist-backed LaunchAgent path contributes to session persistence. In this skill's context, that means configuration-monitoring code will continue to execute automatically, which becomes dangerous if the deployed scripts can be altered by other local processes or future agent actions.

Content

Scanner excerpt · scripts/install.sh (reported line 22)May include surrounding context.

sh
# 2. 部署 launchd plist(第一层守护)
echo "🚀 注册第一层守护(launchd WatchPaths)..."
PLIST_SRC="$HOME/.openclaw/skills/config-modification-safety/scripts/com.openclaw.config-guard.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

# 替换路径占位符

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The use of a plist-backed LaunchAgent path contributes to session persistence. In this skill's context, that means configuration-monitoring code will continue to execute automatically, which becomes dangerous if the deployed scripts can be altered by other local processes or future agent actions.

Content

Scanner excerpt · scripts/install.sh (reported line 22)May include surrounding context.

sh
# 2. 部署 launchd plist(第一层守护)
echo "🚀 注册第一层守护(launchd WatchPaths)..."
PLIST_SRC="$HOME/.openclaw/skills/config-modification-safety/scripts/com.openclaw.config-guard.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

# 替换路径占位符

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This line finalizes creation of the LaunchAgent plist, which is a standard persistence mechanism. In the agent-skill context, hidden or under-explained persistence is riskier because users may not expect background execution to survive the installation session.

Content

Scanner excerpt · scripts/install.sh (reported line 23)May include surrounding context.

sh
# 2. 部署 launchd plist(第一层守护)
echo "🚀 注册第一层守护(launchd WatchPaths)..."
PLIST_SRC="$HOME/.openclaw/skills/config-modification-safety/scripts/com.openclaw.config-guard.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

# 替换路径占位符
sed "s|/Users/mingming|$HOME|g" "$PLIST_SRC" > "$PLIST_DST"

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This line finalizes creation of the LaunchAgent plist, which is a standard persistence mechanism. In the agent-skill context, hidden or under-explained persistence is riskier because users may not expect background execution to survive the installation session.

Content

Scanner excerpt · scripts/install.sh (reported line 23)May include surrounding context.

sh
# 2. 部署 launchd plist(第一层守护)
echo "🚀 注册第一层守护(launchd WatchPaths)..."
PLIST_SRC="$HOME/.openclaw/skills/config-modification-safety/scripts/com.openclaw.config-guard.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

# 替换路径占位符
sed "s|/Users/mingming|$HOME|g" "$PLIST_SRC" > "$PLIST_DST"

Session Persistence

Medium
Category
Rogue Agent
Confidence
97% confidence
Finding

Calling launchctl load activates the LaunchAgent immediately, enabling automatic execution beyond the current shell session. Immediate activation of persistence increases risk because it can start running unattended without a separate review step by the user.

Content

Scanner excerpt · scripts/install.sh (reported line 26)May include surrounding context.

sh
PLIST_DST="$HOME/Library/LaunchAgents/com.openclaw.config-guard.plist"

# 替换路径占位符
sed "s|/Users/mingming|$HOME|g" "$PLIST_SRC" > "$PLIST_DST"
launchctl load "$PLIST_DST" 2>/dev/null || echo "  (可能已加载,跳过)"

# 3. 部署 cron 任务(第二层守护)

Session Persistence

Medium
Category
Rogue Agent
Confidence
97% confidence
Finding

This line is part of the active launchd persistence flow and indicates the LaunchAgent is being enabled. In a security-sensitive review, automatic background execution is noteworthy because it creates a long-lived foothold for whatever code the agent references.

Content

Scanner excerpt · scripts/install.sh (reported line 27)May include surrounding context.

sh
# 替换路径占位符
sed "s|/Users/mingming|$HOME|g" "$PLIST_SRC" > "$PLIST_DST"
launchctl load "$PLIST_DST" 2>/dev/null || echo "  (可能已加载,跳过)"

# 3. 部署 cron 任务(第二层守护)
echo "⏰ 注册第二层守护(cron 健康巡检)..."

Session Persistence

Medium
Category
Rogue Agent
Confidence
97% confidence
Finding

This line is part of the active launchd persistence flow and indicates the LaunchAgent is being enabled. In a security-sensitive review, automatic background execution is noteworthy because it creates a long-lived foothold for whatever code the agent references.

Content

Scanner excerpt · scripts/install.sh (reported line 27)May include surrounding context.

sh
# 替换路径占位符
sed "s|/Users/mingming|$HOME|g" "$PLIST_SRC" > "$PLIST_DST"
launchctl load "$PLIST_DST" 2>/dev/null || echo "  (可能已加载,跳过)"

# 3. 部署 cron 任务(第二层守护)
echo "⏰ 注册第二层守护(cron 健康巡检)..."

Session Persistence

Medium
Category
Rogue Agent
Confidence
96% confidence
Finding

The installer writes a cron entry that executes every 5 minutes, creating persistent background execution. In the context of an agent skill, this is security-relevant because recurring execution can be abused if the referenced script or workspace is later tampered with, and the user may not realize ongoing code is being run.

Content

Scanner excerpt · scripts/install.sh (reported line 34)May include surrounding context.

sh
CRON_LINE="*/5 * * * * $HOME/.openclaw/workspace/.lib/config-safety/health-check.sh >> $HOME/.openclaw/workspace/.lib/config-safety/health-check.log 2>&1"

# 读取现有 crontab,移除旧的任务(避免重复)
(crontab -l 2>/dev/null | grep -v "config-safety/health-check"; echo "$CRON_LINE") | crontab -

# 4. 创建初始备份
echo "💾 创建初始配置备份..."

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 61)May include surrounding context.

md
echo "  查看守护状态:launchctl list | grep config-guard"
echo "  查看守护日志:tail -f $HOME/.openclaw/workspace/.lib/config-safety/guard.log"
echo "  手动回滚:python3 $HOME/.openclaw/workspace/.lib/config-safety/guard.py rollback"
echo "  卸载:launchctl unload $HOME/Library/LaunchAgents/com.openclaw.config-guard.plist && crontab -r"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install.sh (reported line 51)May include surrounding context.

sh
echo "  查看守护状态:launchctl list | grep config-guard"
echo "  查看守护日志:tail -f $HOME/.openclaw/workspace/.lib/config-safety/guard.log"
echo "  手动回滚:python3 $HOME/.openclaw/workspace/.lib/config-safety/guard.py rollback"
echo "  卸载:launchctl unload $HOME/Library/LaunchAgents/com.openclaw.config-guard.plist && crontab -r"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring presents this file as the 'first-layer' guard whose principle is listening for config changes, validating JSON syntax, and immediately rolling back on errors. In addition to rollback, the code also restarts the Gateway during rollback, which is a broader operational action not described in this file's stated behavior.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/guard.py (reported line 92)May include surrounding context.

python
def restart_gateway():
    """重启 Gateway"""
    log("重启 Gateway...")
    result = subprocess.run(
        ["openclaw", "gateway", "restart"],
        capture_output=True, text=True
    )