Back to skill

Security audit

智能体安全管家

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible security-audit tool, but it needs review because offline scans still create a persistent device ID and the audit reads broad sensitive local data that is not fully disclosed.

Review before installing. Use it only if you are comfortable with a local security audit reading broad system, workspace, SSH/GPG, process, and agent-memory metadata and writing persistent files under ~/.openclaw. Avoid running it as root, do not use --push unless you trust Changeway's server with device and skill-inventory data, and check for/remove ~/.openclaw/.agent-id and any openclaw cron jobs if you do not want persistence.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/openclaw-hybrid-audit-changeway.js:1146
Finding

Persistent Device Identifier Is Created During Offline Scans

Content
View full analysis
0 ? "warning" : "success"; const checkedCount = ITEM_SEQ - SKIP_COUNT; const passCount = checkedCount - RED_COUNT; let outputObj = { report_time: REPORT_TIME, status, red_item: RED_COUNT, checkedCount: checkedCount, passCount: passCount, agent_id: agentId, data: JSON_DATA }; // ... fs.writeFileSync(JSON_OUT_FILE, JSON.stringify(outputObj, null, 2), { encoding: 'utf-8', mode: 0o600 }); // ... if (!PUSH_ENABLED) { SUMMARY += `${COLORS.dim}────────────────────────────────────────────────────────────────────────${COLORS.reset}\n`; console.log(SUMMARY); console.log(`${COLORS.dim}Detailed audit report saved to: \`${REPORT_FILE}\`${COLORS.reset}`); process.exit(0); return; } } ``` ### Technical Analysis `finalizeAndPushData()` invokes `generateAgentId()` before checking `PUSH_ENABLED`. Consequently, a normal offline scan creates or reuses the persistent file `~/.openclaw/.agent-id`, even though the Skill documentation states that this identifier is created only when the user explicitly selects `--push`. The identifier is also included in the locally persisted JSON report. A later network-enabled run reuses the same value, allowing sca ...[truncated 1286 chars]
Remediation
View remediation
0 ? "warning" : "success"; const checkedCount = ITEM_SEQ - SKIP_COUNT; const passCount = checkedCount - RED_COUNT; const outputObj = { report_time: REPORT_TIME, status, red_item: RED_COUNT, checkedCount, passCount, data: JSON_DATA }; if (!PUSH_ENABLED) { fs.writeFileSync( JSON_OUT_FILE, JSON.stringify(outputObj, null, 2), { encoding: 'utf-8', mode: 0o600 } ); // Finish without creating an agent identifier. return; } const agentId = generateAgentId(); outputObj.agent_id = agentId; // Continue with the consented upload. } ``` 2. Do not include `agent_id` in offline JSON reports. 3. Add a migration option that informs users about and, with confirmation, removes identifiers created by previous offline runs. 4. Add an automated test asserting that an offline execution does not create `.agent-id`. 5. Add a second test confirming that `--push` creates the identifier only after explicit mode selection. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/openclaw-hybrid-audit-changeway.js:1060
Finding

Undisclosed Access to Persistent Agent Memory

Content
View full analysis
{ if (!f.toLowerCase().endsWith('.md')) return false; return f.startsWith(todayStr) || f.startsWith(yestStr); }) .map(f => buildSafeChildPath(memoryDir, f)) .filter(Boolean) .sort(); } catch (e) { return []; } } const memoryDir = path.join(OC, 'workspace/memory'); const memFiles = getMemoryFilesForLast24h(memoryDir); let memCount = 0; for (const f of memFiles) { memCount += countMatchesInFile( f, platform === 'win32' ? /privileged/gim : /sudo/gim ); } const privLabel = platform === 'win32' ? 'privileged extraction' : 'Sudo'; let detail13 = `${privLabel} Count (Today): ${sudoCount}\n` + `Memory Count (Today): ${memCount}\n` + `Memory Files (Matched): ${memFiles.length}\n` + `${memFiles.length ? memFiles.join('\n') : '(none)'}`; ``` ### Technical Analysis The Skill opens recent Markdown files from `~/.openclaw/workspace/memory` and scans their full contents for privilege-related terms. Agent memory may contain conversation-derived data, user preferences, operational context, or other persistent private information. The privacy declaration identifies system logs, MAC address, hostname, temporary paths, and the installed Skill inventory, but it does not clearly identify persistent Agent-memory files as an input to the scan. Therefore, the access exceeds the specifically disclosed data boundary. The implementation only records match counts and file paths rather than m ...[truncated 1355 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/openclaw-hybrid-audit-changeway.js:272
Finding

Default and Optional Audits Traverse an Excessively Broad Sensitive Host Surface

Content
View full analysis
{ const m = entry.match(sensitivePattern); if (m) hitNames.push(m[1] + '=(REDACTED)'); }); ...[truncated 4878 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill’s declared behavior understates or misstates several material actions: persistent agent_id creation, baseline/hash snapshot writes, actual cron behavior, and the breadth of uploaded identifiers and skill metadata. This is dangerous because users and policy engines may consent to a narrower privacy/security impact than what the skill actually performs, undermining informed consent and trust boundaries.

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 68)May include surrounding context.

md
macOS/Linux:shasum -a 256 scripts/openclaw-hybrid-audit-changeway.js

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

配置定时任务。配置完成后再继续第三步。

  • 用户选 2(或回复"先跑一次"、"以后再说"、"跳过"等含义)→ 创建标记文件 ~/.openclaw/.audit-first-run(内容写 skipped),然后继续第三步。

关于定时任务的硬性要求:

  • 必须使用 openclaw cron add 命令
  • 禁止使用系统 crontab(crontab -e 等)
  • 原因:系统 crontab 无法正确初始化 OpenClaw 环境,会导致执行失败
  • ⚠️ 基础设施绑定说明:使用 openclaw cron 会将定时执行与 openclaw 基础设施绑定;如不希望依赖此基础设施,可不设置定时任务,改为手动执行
  • cron 命令中严禁添加 --push 参数:定时任务只以本地离线模式运行,绝不自动向远端上报设备标识

第三步:询问检测模式

向用户发送以下消息,然后等待用户回复:

text
请选择检测模式:

1. 仅本地扫描(默认)— 不联网、不发送任何数据
   · �

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/cron-setup.md (reported line 16)May include surrounding context.

OpenClaw 安全巡检定时任务配置指南

⚠️ 重要警告(必读)

必须使用 openclaw cron,禁止使用系统 crontab

❌ 错误做法:使用 crontab -e 或编辑 /etc/crontab

✅ 正确做法:使用 OpenClaw 内置的 cron 系统

bash
openclaw cron add ...

原因:

  1. 系统 crontab 无法正确初始化 OpenClaw 环境变量和会话
  2. 会导致执行失败、权限问题或推送异常
  3. openclaw cron 自动处理隔离会话、超时、推送等逻辑

快速配置

使用 OpenClaw Cron 注册

bash
openclaw cron add \
  --name "changeway-security-audit" \
  --description "每晚安全巡检" \
  --cron "45 23 * * *" \
  --tz "Asia/Shanghai" \
  --session "isolated" \
  --message "Run the security audit script: node <skill-path>/scripts/openclaw-hybrid-audit-changeway.js — then from the output extract and report ONLY these three items: (1) the l

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 274)May include surrounding context.

js
if (platform === 'win32') {
        configFiles.push(
            path.join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'ssh', 'sshd_config'),
            path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config')
        );
    } else {

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 280)May include surrounding context.

js
if (platform === 'win32') {
        configFiles.push(
            path.join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'ssh', 'sshd_config'),
            path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config')
        );
    } else {

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 658)May include surrounding context.

js
if (platform === 'win32') {
        configFiles.push(
            path.join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'ssh', 'sshd_config'),
            path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config')
        );
    } else {

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 675)May include surrounding context.

js
if (platform === 'win32') {
        configFiles.push(
            path.join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'ssh', 'sshd_config'),
            path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config')
        );
    } else {

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

Including /etc/passwd in the baseline causes the script to read a system account database file outside the declared sensitive-information scope. While /etc/passwd is often world-readable, enumerating it still expands host reconnaissance and should be explicitly justified and disclosed.

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 282)May include surrounding context.

js
'/etc/ssh/sshd_config',
            path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config'),
            '/etc/passwd',
            '/etc/shadow'
        );
    }

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The script attempts to hash /etc/shadow, a highly sensitive credential store, during baseline generation. Accessing this file is unnecessary for most agent security audits, requires elevated privileges, and materially increases the risk of credential exposure or abuse if the tool or its outputs are compromised.

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 283)May include surrounding context.

js
path.join(HOME, '.ssh/authorized_keys'),
            path.join(HOME, '.ssh/config'),
            '/etc/passwd',
            '/etc/shadow'
        );
    }

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/openclaw-hybrid-audit-changeway.js (reported line 1061)May include surrounding context.

js
// Event ID 4672 = 特权提升
    let psOut = spawnCmd('powershell', ['-NoProfile', '-Command',
        `(Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4672; StartTime=(Get-Date).AddDays(-1)} -ErrorAction SilentlyContinue | Measure-Object).Count`
    ]);
    sudoCount = parseInt(psOut, 10) || 0;
}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
98% confidence
Finding

The skill requires shell and environment access to read system identifiers, logs, installed skills, and to write persistent files, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of overbroad execution because hosts and reviewers cannot enforce least privilege or clearly understand what capabilities the skill needs before activation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file specifies user-facing descriptions, prompts, and reply formats entirely in Chinese, while also advertising English trigger coverage such as “security audit.” There is no indication that users may choose their preferred language, which can violate language/locale policy when applied to broader audiences.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad trigger phrases like “巡检” and “系统安全” can cause the skill to activate on generic user requests unrelated to this specific tool. Because this skill reads sensitive local information and can optionally persist data or initiate setup flows, accidental activation expands privacy risk and may lead to surprising privileged behavior.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
84% confidence
Finding

Declaring use of sudo as part of supported system commands indicates the skill may invoke privileged context or inspect privileged data paths. Even if intended for read-only auditing, introducing sudo into an agent skill materially raises the blast radius if the command set expands, the host configuration is weak, or users are socially engineered into granting elevation.

Content

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

md
必需:Node.js v18+
    可选:openclaw CLI(用于定时任务管理;若使用定时巡检功能,需依赖 openclaw cron 命令)
    脚本调用的系统命令(缺失时对应检查项会 SKIP,不影响其他项):
      macOS:find、lsof、netstat、ps、last、lastb、grep、awk、cat、sudo
      Linux:find、ss、lsof、ps、journalctl、last、lastb、grep、awk、cat、sudo
      Windows:wmic、netstat、tasklist、findstr

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
84% confidence
Finding

The Linux command list also includes sudo, which signals potential privileged execution or privileged-state inspection. In an agent environment, any elevation-capable path is sensitive because mistakes, future feature creep, or wrapper abuse can turn a read-only audit tool into one that operates with higher-than-expected system authority.

Content

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

md
可选:openclaw CLI(用于定时任务管理;若使用定时巡检功能,需依赖 openclaw cron 命令)
    脚本调用的系统命令(缺失时对应检查项会 SKIP,不影响其他项):
      macOS:find、lsof、netstat、ps、last、lastb、grep、awk、cat、sudo
      Linux:find、ss、lsof、ps、journalctl、last、lastb、grep、awk、cat、sudo
      Windows:wmic、netstat、tasklist、findstr

security_notes: |

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill explicitly supports configuring recurring scheduled execution through openclaw cron, creating persistent behavior on the host. Even though it is presented as optional and local-only, persistence increases risk because sensitive scans and file writes will continue after the initial session and may be forgotten, misconfigured, or later combined with changed code or environment.

Content

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

md
**关于定时任务的硬性要求**:
- 必须使用 `openclaw cron add` 命令
- 禁止使用系统 crontab(`crontab -e` 等)
- 原因:系统 crontab 无法正确初始化 OpenClaw 环境,会导致执行失败
- ⚠️ 基础设施绑定说明:使用 `openclaw cron` 会将定时执行与 openclaw 基础设施绑定;如不希望依赖此基础设施,可不设置定时任务,改为手动执行
- **cron 命令中严禁添加 `--push` 参数**:定时任务只以本地离线模式运行,绝不自动向远端上报设备标识

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
✅ 安全。扫描了工作区的所有文件,没有发现明文写死的私钥或助记词。

### 13. 特权提权(Sudo)操作对账审计
✅ 安全。今天系统没有执行过 sudo 特权命令,Agent 的记忆记录也没有相关内容,两边对账一致,不存在偷偷提权的情况。

### 14. 生态组件恶意威胁情报扫描
✅ 安全。已列出本机安装的 54 个 Skill 组件,全部在安全名单中。(如果使用了完整检测模式且命中威胁情报,这里会显示具体的恶意组件和处置建议。)

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cron-setup.md (reported line 7)May include surrounding context.

md
### 必须使用 `openclaw cron`,禁止使用系统 crontab

❌ **错误做法**:使用 `crontab -e` 或编辑 `/etc/crontab`


✅ **正确做法**:使用 OpenClaw 内置的 cron 系统

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cron-setup.md (reported line 127)May include surrounding context.

md
### 必须使用 `openclaw cron`,禁止使用系统 crontab

❌ **错误做法**:使用 `crontab -e` 或编辑 `/etc/crontab`


✅ **正确做法**:使用 OpenClaw 内置的 cron 系统

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cron-setup.md (reported line 123)May include surrounding context.

常见错误及修复

错误 1:使用了系统 crontab

现象:任务显示在 crontab -l 中,但执行失败或没有推送 修复:

bash
# 1. 删除系统 crontab 中的任务

Scope Creep

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script hashes highly sensitive files including /etc/shadow, /etc/passwd, and SSH configuration material as part of baseline generation. Even if it does not print file contents, it still performs undeclared access to credential- and identity-related files, expanding the skill's privilege footprint beyond the manifest and creating unnecessary exposure if the script is run with elevated privileges.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script recursively scans broad sensitive roots such as /etc, ~/.ssh, ~/.gnupg, /usr/local/bin, and the entire OpenClaw state tree for recent changes. This exceeds the manifest's declared scope and can enumerate security-sensitive metadata across the host, increasing privacy and reconnaissance risk if the skill is misused or compromised.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

On Linux, the script reads /proc//environ for another process to identify secret-like environment variable names. Accessing another process's environment is sensitive because it can reveal credential presence, deployment details, and sometimes actual secrets if protections fail or future code changes log more than intended.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script recursively scans the workspace for secret-like patterns, including hex private-key material and mnemonic phrases. This is broader than the declared access scope and can inspect arbitrary user project files, creating significant privacy and data-handling risk even if the intention is defensive.

Content

No source excerpt is available for this finding.