Back to skill

Security audit

Nutstore WebDAV Storage

Security checks for vulnerabilities and agentic risk

Overview

This backup skill fits its stated purpose, but it needs review because it can upload and restore workspace data while failing to enforce promised sensitive-file exclusions and path boundaries.

Review and fix the scripts before installing for real backups. Add mandatory rclone filters and explicit rejection of sensitive paths, validate agent names as safe single path components, enforce canonical containment for all local source and destination paths, and test restore into a separate RESTORE_TARGET_ROOT before using live workspace or cron automation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/backup-openclaw-to-nutstore.sh:22
Finding

Documented sensitive-file exclusions are not enforced during backup

Content
View full analysis
$dst" "$RCLONE_BIN" sync "$src" "$dst" "${extra_args[@]}" else echo "[skip] directory not found: $src" fi } ``` ```bash src="$agent_root/$rel_path" if [ -d "$src" ]; then sync_dir "$src" "$remote_agent_root/$rel_path" elif [ -f "$src" ]; then remote_dir="$(dirname "$rel_path")" if [ "$remote_dir" = "." ]; then remote_file="$remote_agent_root/$rel_path" else remote_file="$remote_agent_root/$remote_dir/$(basename "$rel_path")" fi copy_file_to "$src" "$remote_file" ``` ```bash for file in "${IDENTITY_FILES[@]}"; do copy_file "$agent_root/$file" "$remote_agent_root/identity" done sync_dir "$agent_root/memory" "$remote_agent_root/memory" ``` The behavior conflicts with the exclusion rules documented in `SKILL.md:172-182` and `references/storage-scope.md:86-95`, which state that paths such as `secrets`, `cookies`, `.secret.key`, virtual environments, `node_modules`, and temporary directories are excluded. ### Technical Analysis Every directory backup invokes `rclone sync` without an `--exclude`, `--filter`, or `--filter-from` option. Custom file backups similarly use `copyto` without first rejecting sensitive file names or sensitive parent directories. As a result, the documented exclusions are descriptive only and have no enforcement in the executable implementation. Sensitive content is uploaded whenever it appears beneath the default `memory` directory or beneath a directory selected through `CUSTOM_BACKUP_PATHS`. A sensitive file can also be selected directly in custom mode. Because the destination ...[truncated 1632 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/restore-openclaw-from-nutstore.sh:45
Finding

Unvalidated agent names permit backup and restore paths to escape the workspace root

Content
View full analysis
&2 echo "[hint] use RESTORE_TARGET_ROOT for restoration into a test directory" >&2 exit 2 } ``` Default restoration then writes to the constructed path without validating that it remains under `RESTORE_TARGET_ROOT`: ```bash restore_scope_default() { local scope="$1" local remote_path destination remote_path="$NUTSTORE_REMOTE/$AGENT/$scope" if [ "$scope" = "identity" ]; then destination="$agent_root" else destination="$agent_root/memory" fi mkdir -p "$destination" echo "[restore] $remote_path -> $destination" "$RCLONE_BIN" copy "$remote_path" "$destination" "${extra_args[@]}" } ``` ### Technical Analysis The scripts assume that `AGENTS` and `AGENT` contain trusted simple names such as `chief` or `backend`, but no allowlist or path-component validation is performed. A value containing `..` is concatenated dir ...[truncated 2686 chars]
Remediation
View remediation
&2 exit 2 ;; esac } ``` 2. If arbitrary agent names are required, accept only a single safe path component: ```bash case "$AGENT" in ""|.|..|*/*|*\\*) echo "[error] unsafe agent name" >&2 exit 2 ;; esac ``` 3. Canonicalize both the configured root and candidate destination with `realpath` or `realpath -m`, then enforce containment: ```bash canonical_root="$(realpath -m "$RESTORE_TARGET_ROOT")" canonical_agent="$(realpath -m "$RESTORE_TARGET_ROOT/$AGENT")" case "$canonical_agent/" in "$canonical_root"/*/) ;; *) echo "[error] agent path escapes restore root" >&2 exit 2 ;; esac ``` 4. Apply equivalent canonical containment checks to: - `WORKSPACE_ROOT/$agent` - Every custom backup source - `RESTORE_TARGET_ROOT/$AGENT` - Every custom restore destination 5. Reject symlinks in destination path components or use a safe directory-descriptor-based implementation where supported, preventing existing symlinks from redirecting writes. 6. Require explicit confirmation for all restoration scopes targeting the live workspace, not only `path` scope. 7. Add regression tests for agent values such as `..`, `../..`, absolute paths, names containing separators, and destinations involving symlinks. ]]>
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 (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明将该 skill 定位为“为 OpenClaw 多 agent 工作区做备份、归档与恢复”的工具,核心能力应包括把本地文件/目录备份到坚果云、可能的归档组织,以及从远端恢复内容。但提供的代码只是一个检查脚本:通过 rclone lsf 探测 remote、agent 目录、identity/memory 目录及一个可选相对路径是否存在,并输出 ok/warn/error 汇总。它没有读取本地工作区内容、没有执行上传/同步/复制、没有归档逻辑、也没有恢复逻辑。因此代码行为与声明的主要用途存在实质性不符。尽管它与坚果云备份场景相关,最多只能算备份结果的健康检查/验证子功能,而不能代表所宣称的完整备份、归档与恢复 skill。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个完整的坚果云 WebDAV 备份/归档/恢复 skill,包含默认备份范围和排除规则;但提供的代码片段只是一个配置辅助脚本,用于引导用户设置 rclone 的 Nutstore WebDAV remote。该代码没有访问 OpenClaw 工作区、没有枚举或传输文件、没有执行归档或恢复,也没有体现任何默认备份路径或敏感文件排除策略。因此代码实际行为与声明的主要用途存在实质性不一致。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
用:`scripts/backup-openclaw-to-nutstore.sh`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
用:`scripts/backup-openclaw-to-nutstore.sh`

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file is entirely presented in Chinese, starting from the title, with no indication that users may choose another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The error message is hard-coded in Chinese ("rclone 未安装,请先安装 rclone") with no option to select language or indication that the skill is intended only for Chinese-speaking users. This is a natural-language locale policy issue because the script imposes a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This shell script emits user-facing status and error text in Chinese (for example, the installation error at L042), and similar hardcoded Chinese strings appear throughout the script. For a general-purpose utility, forcing a specific language without offering a locale choice or documenting that the skill is intentionally Chinese-only is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's user-facing error and instructional text is entirely in Chinese, including the install error and configuration guidance. This imposes a specific language on all users without opt-in or justification, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script emits user-facing instructional text in Chinese (for example the prerequisite and guidance comments) with no option to select another language and no documented reason for the locale restriction. This is a natural-language policy issue because the skill imposes a specific language on users rather than offering choice or clearly scoping the skill to a Chinese-only context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script presents all user-facing messages, errors, and usage instructions in Chinese only. This is a natural-language locale constraint, and the file does not offer an opt-in language choice or explain that the skill is intentionally region- or locale-specific.

Content

No source excerpt is available for this finding.