Back to skill

Security audit

OpenClaw Smart Backup

Security checks for vulnerabilities and agentic risk

Overview

This backup skill appears purpose-built rather than malicious, but it has real review-worthy risks around broad local backups, secret-file exclusion mistakes, and automatic deletion of old archives.

Review before installing. Use dry-run first, set an explicit output directory, avoid untrusted custom config or prefix values, and do not assume key, certificate, or secret-looking files are excluded unless you verify the generated file list. Keep generated archives protected because they may contain private workspace or configuration data.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup.py:221
Finding

File Symlinks Bypass the Documented Exclusion Policy

Content
View full analysis
bool: """判断文件是否应被排除""" file_path = file_path.resolve() name = file_path.name name_lower = name.lower() ext = file_path.suffix.lower().lstrip(".") # 1. 符号链接/联接点 try: if file_path.is_symlink() or self._is_junction(file_path): self.stats["by_symlink"] += 1 self.stats["total_skipped"] += 1 return True ``` The file is subsequently added to the archive: ```python with tarfile.open(output_file, f"w:gz", compresslevel=compression) as tar: for file_path in files: try: arcname = normalize_tar_path(file_path) tar.add(file_path, arcname=arcname) ``` Archive names are also calculated from resolved paths: ```python def normalize_tar_path(path: Path) -> str: """将路径标准化为 tar 归档名,保留绝对路径""" abs_path = str(path.resolve()) if len(abs_path) >= 2 and abs_path[1] == ":": abs_path = abs_path[0] + "_/" + abs_path[2:] return abs_path.replace("\\", "/") ``` ### Technical Analysis `Path.resolve()` follows a symbolic link and returns its target before the code calls `is_symlink()`. The resolved target is ordinarily not itself a symlink, so the test no longer identifies the original directory entry as a symbolic link. The rebinding performed inside `is_excluded()` does not modify the `Path` object retained by `collect_files()`. As a result, the original file symlink can be appended to the collection and passed to `tar.add()`. Meanwhile, `normalize_tar_path()` derives the archive member name from the resolved target. This produces inconsistent behavior in which a link from the scanned workspace can be archived under a name representing its target. This violates the documente ...[truncated 1671 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup.py:68
Finding

Wildcard Secret-File Exclusions Are Treated as Literal Filenames

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup.py:482
Finding

Unvalidated Backup Prefix Can Broaden Archive Placement and Retention Deletion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/backup.py (reported line 70)May include surrounding context.

python
],
    "excluded_files": [
        ".DS_Store", "Thumbs.db", "desktop.ini",
        ".env.local", ".env.development", ".env.production",
        "*.local", "*.secret", "*.key", "*.pem", "*.crt"
    ],
    "excluded_by_content": [

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/backup.py (reported line 70)May include surrounding context.

python
],
    "excluded_files": [
        ".DS_Store", "Thumbs.db", "desktop.ini",
        ".env.local", ".env.development", ".env.production",
        "*.local", "*.secret", "*.key", "*.pem", "*.crt"
    ],
    "excluded_by_content": [

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/backup.py (reported line 70)May include surrounding context.

python
],
    "excluded_files": [
        ".DS_Store", "Thumbs.db", "desktop.ini",
        ".env.local", ".env.development", ".env.production",
        "*.local", "*.secret", "*.key", "*.pem", "*.crt"
    ],
    "excluded_by_content": [

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill describes reading environment-dependent paths, scanning user directories, writing configuration, and creating/deleting backup files, but it does not declare any explicit tool scope or permissions. That mismatch can cause the agent to invoke file and environment capabilities without clear user-visible constraints, increasing the risk of overbroad filesystem access and unintended modification of local data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad and generic, including phrases like '运行智能备份' and '预览备份', which could match ordinary conversation and activate the skill unexpectedly. In this skill's context, accidental invocation is more dangerous because activation can lead to filesystem enumeration, archive creation, and later deletion of older backups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill performs retention cleanup that deletes older backup files, but this destructive behavior is not prominently disclosed up front in the description or invocation section. Users may reasonably treat the skill as purely additive backup behavior and be surprised by data deletion, especially if the output directory contains backups they intended to keep.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script automatically removes backup files beyond the retention limit using file.unlink(), which is a destructive operation. Although deletion is logged after it occurs, there is no prior confirmation prompt or explicit warning at the point of execution that older backups will be permanently deleted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description and user-facing instructions are presented in Chinese, and the skill examples assume Chinese-language interaction, but there is no indication that this language requirement is optional or region-specific. Under the policy, forcing a specific language without user opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.