Back to skill

Security audit

Config Rollback

Security checks for vulnerabilities and agentic risk

Overview

The skill has a clear OpenClaw rollback purpose, but it installs an ongoing cron watchdog that can overwrite configuration and restart Gateway without tight cleanup, consent, or validation controls.

Install only if you intentionally want a recurring user-level cron job that can restore ~/.openclaw/openclaw.json and restart OpenClaw Gateway. Before installing, review the scripts, avoid running them as a privileged account, check your crontab, and be prepared to manually remove the rollback-guardian entry if you no longer need it.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (2)

T06 · System Persistence

Error
Location
scripts/install.sh:31
Finding

Indefinite Cron-Based Execution of a Mutable Guardian Script

Content
View full analysis
/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * $OPENCLAW_DIR/scripts/rollback-guardian.sh") | crontab - echo " ✅ Cron 任务已添加" ``` The same persistent installation mechanism is documented in `SKILL.md:126-136`: ```bash (crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * ~/.openclaw/workspace/skills/config-rollback/scripts/rollback-guardian.sh") | crontab - ``` ### Technical Analysis The installer adds a cron entry that executes `~/.openclaw/scripts/rollback-guardian.sh` every minute. This task survives the installation process, shell sessions, and individual rollback operations. It remains installed even when no configuration change is pending. Scheduled monitoring is related to the declared automatic rollback functionality and is documented. Nevertheless, permanent minute-by-minute execution exceeds the minimum lifecycle required for a five-minute rollback window. The task should only exist while a protected configuration change is pending. The installation process first copies the guardian into a general user-writable script directory: ```bash mkdir -p $OPENCLAW_DIR/scripts cp $SCRIPT_DIR/*.sh $OPENCLAW_DIR/scripts/ ``` Cron subsequently trusts the mutable script at that location. If another process or actor capable of writing files as the user replaces that script, the replacement will be executed every minute. This does not independently elevate privileges beyond the account that owns the crontab, but it provides a durable recurring execution mechanism within that account. The cron update also removes every existing entry containing the broad substring `rollback-guardian`: ```bash crontab -l 2>/dev/null | grep -v "rollback-guardian" ``` This can unintentionally delete unr ...[truncated 1628 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/rollback-guardian.sh:43
Finding

Rollback Protection Is Cleared Without Verifying That Gateway Restarted

Content
View full analysis
> $LOG rm -f $STATE_FILE exit 0 fi ``` The status check only tests whether any current Gateway reports itself as running: ```bash check_gateway_running() { openclaw gateway status 2>&1 | grep -q "Runtime: running" } ``` Rollback state is created before the user edits the configuration or restarts Gateway in `scripts/prepare-config-change.sh:30-34`: ```bash # 3. 记录状态文件(用于超时回滚) current_time=$(date +%s) echo "$current_time" > $STATE_FILE echo "$backup_file" >> $STATE_FILE echo "$(date): 已记录状态文件" >> $LOG ``` ### Technical Analysis The guardian assumes that a running Gateway proves the post-change restart succeeded. It does not verify that the running process started after the rollback state was created, loaded the modified configuration, or passed a configuration health check. Under the documented workflow, Gateway is normally already running when `prepare-config-change.sh` creates the rollback state. Because cron executes the guardian every minute, the guardian can observe the pre-existing Gateway and immediately remove the state file before the user edits the configuration or attempts a restart. Once the state file is deleted, the guardian exits silently on subsequent invocations: ```bash if [ ! -f $STATE_FILE ]; then exit 0 fi ``` A later failed restart caused by an invalid configuration therefore has no active rollback state. This defeats the principal safety property advertised by the Skill. ### Attack Path 1. Gateway is running normally. 2. The user invokes `prepare-config-change.sh`. 3. The script backs up the current configuration and creates `~/.openclaw/.config-modified-state`. ...[truncated 1316 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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


🔧 安装

自动安装(推荐)

bash
openclaw skills enable openclaw-config-rollback

手动安装

  1. 复制脚本

    bash
    # 脚本已在工作区
    ls ~/.openclaw/workspace/skills/config-rollback/scripts/
    
  2. 设置权限

    bash
    chmod +x ~/.openclaw/workspace/skills/config-rollback/scripts/*.sh
    
  3. 设置 Cron

    bash
    (crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * ~/.openclaw/workspace/skills/config-rollback/scripts/rollback-guardian.sh") | crontab -
    
  4. 验证

    bash
    crontab -l | grep rollback
    

📊 配置流程

text
修改配置
    ↓
执行 prepare-config-change.sh
├─ 自动备份到 backups/
├─ 创建状态文件 .config-modified-state
└─ 记录到 PENDING_VERIFICATION.md
    ↓
5 分钟倒计时开始
    ↓
守护进程每分钟检查
├─ 无状态文件 → 直接退出(安静模式)
├─ Gateway 正常运行 → 清�

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
79% confidence
Finding

The YARA hit is driven by behavior commonly associated with persistence: editing crontab to run a script repeatedly. In this skill's context, the payload is not overtly malicious and appears aligned with a watchdog/auto-rollback purpose, so this is not evidence of malware by itself; however, the persistence mechanism is still dangerous because it can be abused if the script or its directory is modified.

Content

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

sh
�行权限..."
chmod +x $OPENCLAW_DIR/scripts/prepare-config-change.sh
chmod +x $OPENCLAW_DIR/scripts/rollback-guardian.sh
chmod +x $OPENCLAW_DIR/scripts/config-alias.sh
echo "   ✅ 权限已设置"

# 3. 创建备份目录
echo ""
echo "📁 创建备份目录..."
mkdir -p $OPENCLAW_DIR/backups
echo "   ✅ 备份目录已创建"

# 4. 设置 Cron
echo ""
echo "⏰ 设置 Cron 守护任务..."
(crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * $OPENCLAW_DIR/scripts/rollback-guardian.sh") | crontab -
echo "   ✅ Cron 任务已添加"

# 5. 验证
echo ""
echo "🔍 验证安装..."
if [ -x "$OPENCLAW_DIR/scripts/prepare-config-change.sh" ]; then
    echo "   ✅ prepare-config-change.sh 可执行"
else
    echo "   ❌ prepare-config-change.sh 权限问题"
    exit 1
fi

if crontab -l 2>/dev/null | grep -q "rollback-guardian"; then
    echo "   ✅ Cron 任务已配置"
else
    echo "   ❌ Cron 任务配置失败"
    exit 1
fi

# 6. 输出使用说明
echo "

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The final user-facing message explicitly states that the system will automatically roll back within 5 minutes, but the script never creates a timer, background job, cron entry, or other rollback trigger. This false assurance is dangerous because administrators may proceed with risky configuration changes believing there is an automatic recovery path when none exists.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file states that the skill will automatically back up configuration before modification and automatically roll back after a timeout, which implies file writes and potentially disruptive system state changes. The README presents these behaviors as features but does not include a user warning about possible impacts on user data, overwritten configs, or service interruption.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill clearly instructs the user to execute shell commands and install executable scripts, but it does not declare any explicit tool scope such as allowed shell access or permissions. This weakens reviewability and safety boundaries because a consumer cannot tell from metadata that the skill requires command execution and persistence-related changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file mixes an English title with predominantly Chinese descriptions, warnings, steps, and examples, and does not indicate that the skill is region-specific or provide an opt-in language alternative. Under the language/locale policy, forcing one language for operational use without user choice is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The skill installs a cron job that runs every minute, creating persistent execution on the host. Even though the stated purpose is rollback protection, persistence mechanisms are security-sensitive because they survive the current session and can later execute modified or replaced scripts without further user review.

Content

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

  1. 设置 Cron

    bash
    (crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * ~/.openclaw/workspace/skills/config-rollback/scripts/rollback-guardian.sh") | crontab -
    
  2. 验证

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing comments and terminal messages in the shell skill are written in Chinese, including usage instructions and status output. This imposes a specific language on users without any opt-in, fallback, or indication that the skill is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This shell script presents its natural-language comments and user-facing echo output entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. The policy requires flagging language or locale constraints unless the skill offers a choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
94% confidence
Finding

This line establishes session persistence by writing a recurring cron entry that executes a script every minute. Even if intended as a rollback guardian, persistence increases attack surface because any later compromise or tampering of ~/.openclaw/scripts/rollback-guardian.sh gains automatic recurring execution.

Content

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

sh
# 4. 设置 Cron
echo ""
echo "⏰ 设置 Cron 守护任务..."
(crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * $OPENCLAW_DIR/scripts/rollback-guardian.sh") | crontab -
echo "   ✅ Cron 任务已添加"

# 5. 验证

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The installer silently modifies the user's crontab to establish a persistent scheduled task every minute. While periodic execution is plausibly related to an auto-rollback/watchdog feature, persistence at install time is security-sensitive because it creates ongoing code execution from a user-writable path without explicit consent, review, or rollback/uninstall handling.

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 136)May include surrounding context.

md
exit 1
fi

if crontab -l 2>/dev/null | grep -q "rollback-guardian"; then
    echo "   ✅ Cron 任务已配置"
else
    echo "   ❌ Cron 任务配置失败"

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 · scripts/install.sh (reported line 48)May include surrounding context.

sh
exit 1
fi

if crontab -l 2>/dev/null | grep -q "rollback-guardian"; then
    echo "   ✅ Cron 任务已配置"
else
    echo "   ❌ Cron 任务配置失败"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is presented as providing rollback management, timeout protection, and automatic rollback, but it only creates a backup, writes state, and appends verification notes. Operators may rely on a safety mechanism that does not actually exist, increasing the chance that a bad configuration change leaves the system unavailable or misconfigured without recovery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's comments and user-facing output are written exclusively in Chinese, including usage guidance and status messages. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable when no locale choice or justification is provided.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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/prepare-config-change.sh (reported line 21)May include surrounding context.

sh
fi

# 1. 创建备份目录
mkdir -p $BACKUP_DIR

# 2. 备份当前配置
timestamp=$(date +%Y%m%d-%H%M%S)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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/prepare-config-change.sh (reported line 21)May include surrounding context.

sh
fi

# 1. 创建备份目录
mkdir -p $BACKUP_DIR

# 2. 备份当前配置
timestamp=$(date +%Y%m%d-%H%M%S)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script automatically copies a backup over the active configuration and restarts the gateway when a timeout is reached. Although it logs to a file, there is no user-facing disclosure, confirmation prompt, or stdout/stderr notice before performing this write and service restart, both of which can materially affect system state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language content of the skill documentation is effectively limited to Chinese, and the file does not offer an alternative language or state that the skill is intended only for a specific locale. Under the language/locale policy, forcing a specific language without user opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The package description forces a specific language presentation in the manifest text and does not offer any user opt-in or clarify that the skill is intended only for a Chinese-speaking audience. Under the policy, locale or language constraints should either be optional for users or clearly documented as justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content in comments and emitted log messages is written only in Chinese, with no indication that the user can choose another language or that the script is intentionally region-specific. This can violate a language/locale policy requiring user choice or documented justification for a fixed language.

Content

No source excerpt is available for this finding.