Back to skill

Security audit

中文 核心文件管理

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent, but it can read and rewrite sensitive persistent OpenClaw workspace files without strong per-file user controls.

Install only if you want an agent to manage OpenClaw's persistent core files. Before using it, require review of exact files touched, inspect diffs before writes, and avoid letting untrusted text be copied into memory, tools, agents, identity, or bootstrap files without validation.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:32
Finding

Overbroad Read and Write Access to Persistent Agent State

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:32, 45-47, 104-106, 170, 234-237
Vulnerability Type: Excessive access to sensitive workspace files and persistent Agent configuration
Risk Level: Medium

Relevant Skill Instructions

The following is an English rendering of the relevant instructions:

markdown
| Validate organization | Read all core files |

| 4 | user.md   | User context       | User information, preferences, infrastructure |
| 5 | memory.md | Long-term memory   | Important events, key configurations, workflows |
| 6 | tools.md  | Technical settings | Endpoints, hosts, commands, services |

| read  | Read core files   | Required |
| write | Modify core files | Required |
| edit  | Repair sections   | Optional |
| exec  | Verify file state and create backups | Optional |

2. Does it already exist elsewhere?
   → Check all six core files

| Missing file    | Create it from scratch using the correct format |
| New Agent setup | Create all six core files plus bootstrap.md |

Technical Analysis

The Skill directs the Agent to read all core workspace files when validating organization. Those files are expressly documented as containing user information, infrastructure details, long-term memory, endpoints, hosts, commands, behavioral rules, and startup instructions.

It also declares workspace-wide write access as required and permits optional command execution. The instructions do not establish task-specific file allowlists, field-level access restrictions, trust-boundary checks, or mandatory user confirmation before individual files are read or modified. Consequently, a narrow request, such as checking the organization of one file, can cause access to substantially more sensitive state than is necessary.

Write access includes persistent files such as memory.md, agents.md, identity.md, and bootstrap.md. If untrusted content is processed during a management operation, th ...[truncated 2198 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the instruction to read all core files with task-scoped access. Read only the file necessary for the current request.
  2. Require explicit user approval before reading sensitive files such as user.md, memory.md, or tools.md.
  3. Separate read-only validation from modification workflows. Organizational checks should not automatically receive write permission.
  4. Require per-file confirmation before modifying persistent files, especially agents.md, memory.md, identity.md, and bootstrap.md.
  5. Present an exact diff and destination path before every write, then require user approval.
  6. Treat file contents and user-supplied text as untrusted data. Do not interpret embedded instructions while reorganizing or copying content.
  7. Add an allowlist defining which content types and fields may be written to each core file.
  8. Prohibit transferring instructions from untrusted sources into behavioral, memory, tool, or startup files without independent validation.
  9. Prefer dedicated read, write, and edit operations over exec. If command execution is unavoidable, restrict it to fixed commands and validated workspace paths.
  10. Enforce canonical-path checks so file operations cannot escape ~/.openclaw/workspace/ through traversal or symbolic links.
  11. Retain backups outside the active core-file glob and verify backups before overwriting existing state.
  12. Record an audit log identifying the requesting user, files accessed, approved changes, and final write results.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description states '代理之间 → 中文', and the same requirement is repeated later as a rule. This forces a specific language choice for a class of interactions without user or organizational opt-in, matching the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The '使用时机' table uses generic triggers such as '修改核心文件', '验证组织', and '用户询问结构' without clearly limiting scope to the specific OpenClaw core files. These broad conditions could cause unintended invocation during ordinary workspace or file-structure discussions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The language table and rule section prescribe fixed languages by context, including mandatory Chinese for agent interactions and English for code/technical content. Because the file does not present these as user-selectable or explicitly justified region-specific constraints, this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

bash
# 列出核心文件
ls -la ~/.openclaw/workspace/*.md

# 检查文件内容
head -20 ~/.openclaw/workspace/identity.md

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

bash
# 列出核心文件
ls -la ~/.openclaw/workspace/*.md

# 检查文件内容
head -20 ~/.openclaw/workspace/identity.md

Static analysis

No suspicious patterns detected.