Back to skill

Security audit

OpenClaw Safe Config Rollback

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for OpenClaw config rollback, but its safety helper uses broad shell execution and weak temporary-file approval/status handling that could undermine its safeguards.

Review before installing. Use this only for trusted OpenClaw config changes, avoid passing untrusted text into --apply-cmd or --apply-file, and prefer fixing the script to use a private mktemp-created directory with authenticated acknowledgment before relying on it for production rollback safety.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/safe_apply.sh:42
Finding

Predictable Shared Temporary Status File Enables Symlink-Based File Overwrite

Content
View full analysis
/dev/null 2>&1 || true sleep 2 } health_ok() { if ! bash -lc "$HEALTH_CMD" >"$STATUS_FILE" 2>&1; then return 1 fi grep -q "$HEALTH_GREP" "$STATUS_FILE" } ``` ### Technical Analysis The status filename is generated in the shared `/tmp` directory using a timestamp with one-second granularity. It is therefore predictable and is not created atomically. The shell subsequently opens the path through output redirection: ```bash >"$STATUS_FILE" ``` No checks establish that the path is a newly created regular file, that it is owned by the invoking user, or that it is not a symbolic link. An attacker with local access can predict or race the filename and create a symbolic link at that path before the health command runs. Where operating-system symbolic-link protections do not block the operation, shell redirection follows the link and truncates its target before writing the health-command output. The operation occurs with the privileges of the user running `safe_apply.sh`. The status file is also not deleted after execution, and the script does not use a private temporary directory or a cleanup trap. ### Attack Path 1. A local attacker determines when a privileged operator is likely to invoke the script. 2. The attacker calculates likely values of `date +%Y%m%d-%H%M%S`. 3. The attacker creates one or more matching paths such as: ```bash ln -s /target/file /tmp/openclaw-safe-status-20260911-120000.txt ``` 4. The operator runs `safe_apply.sh` during the predicted second. 5. `health_ok` redirects health-command output to the attac ...[truncated 962 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/safe_apply.sh:41
Finding

Predictable Acknowledgment File Allows Explicit Approval to Be Spoofed

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script copies the existing config to a backup and later restores it during rollback, which overwrites the target configuration file. While backup and rollback are logged, there is no explicit disclosure before modification that the user's config file will be changed as part of the apply process.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script executes user-supplied content via bash "$APPLY_FILE" or bash -lc "$APPLY_CMD", which is arbitrary code execution by design. In the context of an agent skill, this is dangerous because any upstream prompt, tool input, or untrusted parameter source can turn a config-change helper into a general shell execution primitive, and the script does not present an explicit safety gate or restriction on what may run.

Content

No source excerpt is available for this finding.