Back to skill

Security audit

安全配置流程 (Nico)

Security checks for vulnerabilities and agentic risk

Overview

This OpenClaw config helper is coherent, but it needs review because it can modify sensitive configuration and persist learned config values without clear limits.

Install only if you want an agent to help modify ~/.openclaw/openclaw.json and run OpenClaw repair/status commands. Review proposed changes and MEMORY.md entries carefully, and do not allow tokens, credentials, raw diffs, logs, endpoint secrets, or authentication values to be persisted. Expect the instructions and linked docs to be Chinese/zh-CN focused.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:197
Finding

Unrestricted Persistence of Configuration-Derived Content in Agent Memory

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 29-31, 62, 197-201, and 209
Vulnerability Type: Persistent agent-memory poisoning
Risk Level: Medium

Vulnerable Instructions

The following is an English rendering of the relevant source instructions:

markdown
| Minor issues (spelling and formatting errors) | Self-learn and record | Do not bother the user; record them in MEMORY.md |
| Important configuration (affecting functions, channels, or authentication) | Notify the user and learn | Keep the user informed and avoid making the same mistake again |
| Repeated errors | Notify, record, and summarize | Build a knowledge base to prevent them permanently |

# Record learned correct configuration values in MEMORY.md

**Operations the AI must perform:**
1. Filter the doctor output and extract key repair information
2. Compare the backup file and interpret the diff
3. Report repaired fields, original values, and new values to the user
4. Record lessons in MEMORY.md
5. Wait three seconds and verify Gateway status

4. **Learning after repair is mandatory** — Record it in MEMORY.md

Technical Analysis

The Skill mandates writing lessons derived from configuration files, backup diffs, and diagnostic output into the persistent MEMORY.md state. This behavior is repeated as a required workflow step rather than presented as an optional action requiring separate user approval.

No controls define:

  • Which configuration fields may be persisted.
  • How credentials, tokens, channel identifiers, or personal data must be redacted.
  • Whether diagnostic content is trusted before it is converted into a persistent lesson.
  • How long entries remain in memory or which future sessions may consume them.
  • Whether raw configuration values, diffs, or log content are prohibited.
  • How a user can review or reject the proposed memory entry.

The Skill explicitly covers authentication, channel, model, ...[truncated 2080 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the unconditional requirement to write lessons into MEMORY.md.
  2. Store validation results in a task-local audit report by default rather than in cross-session memory.
  3. Require explicit user approval for the exact proposed memory entry before any persistent write.
  4. Allowlist safe metadata, such as documented field names and schema versions; prohibit raw values from authentication, channel, session, user, and endpoint fields.
  5. Redact tokens, credentials, identifiers, URLs containing secrets, personal data, and other sensitive values before presenting or storing a summary.
  6. Never persist raw configuration files, backup diffs, logs, command output, or untrusted error messages.
  7. Clearly separate trusted documentation-derived rules from observations derived from local configuration or diagnostic output.
  8. Validate memory entries against a strict schema and reject imperative instructions, tool commands, role changes, and unrelated content.
  9. Record provenance, scope, creation time, and expiration for every approved entry, and provide a user-controlled review and deletion mechanism.
  10. Update TEST-GUIDE.md so tests verify that sensitive or attacker-influenced values cannot enter persistent memory.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (5)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger conditions are broad enough to activate on generic configuration-related requests, not just explicit OpenClaw tasks. This can cause the agent to apply OpenClaw-specific commands and workflows in the wrong context, increasing the chance of unintended file modifications, command execution, or confusing cross-scope behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructions entirely in Chinese, including warnings, test steps, and expected outcomes. The policy for this category flags language or locale constraints when a skill effectively forces a specific language without giving the user an explicit choice or documenting a justified regional limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest sets the skill language to "zh-CN", which imposes a specific language/locale. Under the policy, locale restrictions should either be optional for the user or clearly justified as region-specific; this file provides no such opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction "先查文档 — https://docs.openclaw.ai/zh-CN" hard-codes the Chinese locale, and the same locale-specific documentation requirement is repeated later. This is a language/locale policy issue because the skill mandates a specific language variant without user opt-in or an explanation that the skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The safety rule again requires checking documentation specifically at the zh-CN URL, reinforcing a fixed locale requirement. Because no user opt-in or regional justification is provided, this constitutes a natural-language locale policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.