Back to skill

Security audit

Claw Ctct Security Patrol

Security checks for vulnerabilities and agentic risk

Overview

This is a real security-audit skill, but it asks for broad local inspection and recommends recurring networked reporting with device identifiers that users should review carefully.

Install only if you want a host-wide OpenClaw security patrol and are comfortable with broad local inspection. Prefer local-only mode first, avoid running as root, review the cron command before enabling automation, and do not use --push unless you accept sending device identifiers, installed-skill metadata, and summarized security findings to the remote service.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/openclaw-hybrid-audit-changeway.js:419
Finding

Overly Broad System and Security-Sensitive Directory Reconnaissance

Content
View full analysis
!f.endsWith('.sha256')); ``` ```js if (platform === 'linux') { let ssOut = spawnCmd('ss', ['-tunlp']); portsRaw = ssOut.split('\n') .filter(l => /LISTEN/.test(l) && !/127\.0\.0\.1|::1/.test(l)) .join('\n'); psRaw = spawnCmd('ps', [ '-eo', 'pid,user,%cpu,%mem,comm', '--sort=-%cpu' ]); psRaw = psRaw.split('\n').slice(0, 6).join('\n'); } ``` ### Technical Analysis A standard audit recursively enumerates recently modified files under host-wide and security-sensitive locations, including `/etc`, `~/.ssh`, `~/.gnupg`, and `/usr/local/bin`. It also collects externally listening services and process information. These operations are relevant to a comprehensive host audit, but they exceed the minimum permissions needed for an OpenClaw-focused security check. The resulting report can expose full file paths, usernames, process identifiers, service names, ports, and operational changes. Reports are persisted under the OpenClaw state directory, increasing the impact if another process or user can access them. The implementation silently ignores access failures, so it does not directly bypass operating-system controls. However, running the Skill under a privileged account substantially e ...[truncated 898 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/openclaw-hybrid-audit-changeway.js:508
Finding

Raw Gateway Process Environment Is Read Into Audit Process Memory

Content
View full analysis
{ const m = entry.match(sensitivePattern); if (m) hitNames.push(m[1] + '=(REDACTED)'); }); sensitiveVarCount = hitNames.length; } catch (e) { // Access failure is handled by the audit. } } } ``` ### Technical Analysis The report only retains variable names and replaces values with a redaction marker. Nevertheless, `fs.readFileSync()` first reads the complete `/proc//environ` content, including all gateway environment-variable values, into the audit process. Environment variables commonly contain API tokens, passwords, private-key material, and service credentials. Consequently, these values temporarily exist in `environData` and `envEntries`. They could become accessible through runtime instrumentation, memory inspection, crash dumps, malicious modifications to this script, or a compromised Node.js process. The operation is also broader than necessary: determining whether sensitive variable names exist does not require exposing their values to an external audit process. ### Attack Path 1. The script identifies a process matching `openclaw-gateway`. 2. On Linux, it op ...[truncated 868 chars]
Remediation
View remediation
/environ`. 2. Add a gateway-owned diagnostic endpoint that returns only approved variable names or Boolean configuration-health results. 3. If direct inspection is unavoidable, perform it inside the gateway process and never return values to the caller. 4. Avoid storing raw environment content in JavaScript strings or arrays. 5. Document the inspection clearly and require explicit consent before examining another process. 6. Apply operating-system restrictions that prevent unrelated processes from reading gateway process state. 7. Ensure crash dumps are disabled or tightly protected for processes that may handle credentials. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/openclaw-hybrid-audit-changeway.js:265
Finding

Baseline and Workspace Scans Read Secret-Bearing Files Beyond Necessary Scope

Content
View full analysis
Remediation
View remediation

other

Error
Location
scripts/openclaw-hybrid-audit-changeway.js:1135
Finding

Security Audit Reads Persistent Agent Memory Files

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 ); } ``` ### Technical Analysis The script opens persistent Agent memory files from the current and previous day and searches their complete contents for privilege-related terms. Although the resulting report contains only counts and matched file paths, the helper used by this code reads each full file as UTF-8 text. Persistent Agent memory may contain user conversations, operational instructions, private context, credentials, or other sensitive information unrelated to privilege auditing. A security audit should not need access to general conversational memory merely to reconcile privileged operations. This behavior is not memory poisoning because it does not insert attacker-controlled instructions into memory. It is a privacy-sensitive read operation. ### Attack Path 1. The audit locates the OpenClaw workspace memory directory. 2. It enumerates dated Markdown files for the current and previous day. 3. It reads each selected memory file in full. 4. It searches the con ...[truncated 645 chars]
Remediation
View remediation

other

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

Push Mode Sends Stable Device Identifiers and Security Posture to an External Service

Content
View full analysis
({ item, brief })) }; const pushApiUrl = 'https://auth.ctct.cn:10020/changeway-open/api/pushAuditData'; doSignedPost(pushApiUrl, pushApiPath, pushObj, callback); ``` ```js const assessApiUrl = 'https://auth.ctct.cn:10020/changeway-open/api/skills/assessment'; doSignedPost( assessApiUrl, assessApiPath, { data: skillMetaList }, c ...[truncated 1921 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a local security audit tool, but in 'full' mode it transmits audit summaries and device identifiers including MAC address, hostname, and agent ID to a remote service. This creates a privacy and data-governance risk because users may not expect host fingerprinting and outbound telemetry from a routine audit workflow.

Content

No source excerpt is available for this finding.

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 44)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 "00 02 * * *" \
  --tz "Asia/Shanghai" \
  --session "isolated" \
  --message "Execute this command and output the result as-is, no extra commentary: node <skill-path>/scripts/openclaw-hybrid-audit-changeway.js --push  --then from the output extrac

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 "00 02 * * *" \
  --tz "Asia/Shanghai" \
  --session "isolated" \
  --message "Execute this command and output the result as-is, no extra commentary: node <skill-path>/scripts/openclaw-hybrid-audit-changeway.js --push  --then from the output extrac

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
60% 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 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
95% confidence
Finding

Including /etc/shadow in baseline hashing means the script attempts to read one of the most sensitive files on Unix systems. While the apparent purpose is benign integrity monitoring, this creates elevated-privilege pressure and unnecessary access to credential material; if the script is run as root or later modified, it broadens the blast radius of a compromise and may fail in confusing ways for non-root users.

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
97% confidence
Finding

The skill invokes shell commands and inspects the environment but declares no tool scope or permissions boundary. That makes the skill over-privileged by default and increases the chance an agent runtime will allow command execution more broadly than intended.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger conditions include very common phrases like '检查安全' and '系统安全', which can cause the skill to activate in unintended contexts. Because activation leads to shell execution and optional network transmission, accidental invocation materially raises risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

The skill instructs creation of persistent scheduled tasks via openclaw cron add, which establishes recurring execution on the host. Even though this is framed as a user-facing feature, persistence mechanisms increase risk because a misused or compromised skill can maintain repeated access or repeated data collection over time.

Content

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

md
**关于定时任务的硬性要求**:
- 必须使用 `openclaw cron add` 命令
- 禁止使用系统 crontab(`crontab -e` 等)
- 原因:系统 crontab 无法正确初始化 OpenClaw 环境,会导致执行失败

## 第三步:询问检测模式

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 193)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 123)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 119)May include surrounding context.

常见错误及修复

错误 1:使用了系统 crontab

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

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

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file’s description and nearly all user-facing console/report strings are written in Chinese, indicating the skill is effectively locked to a specific language. The policy requires either user choice/opt-in or a clearly documented and justified locale constraint, neither of which appears in this code file.

Content

No source excerpt is available for this finding.

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 · scripts/openclaw-hybrid-audit-changeway.js (reported line 1049)May include surrounding context.

js
itemName = platform === 'win32' ? "特权提取操作对账审计" : "特权提权(Sudo)操作对账审计";
fs.appendFileSync(REPORT_FILE, platform === 'win32'
    ? `\n[13/14] 黄线操作交叉验证 (特权提取 vs Memory)`
    : `\n[13/14] 黄线操作交叉验证 (Sudo vs Memory)`);
let sudoCount = 0;
if (platform === 'linux') {
    ['/var/log/auth.log', '/var/log/secure'].forEach(logPath => {

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is presented as a local security inspection tool, but when run with --push it uploads audit summaries and the installed-skill inventory to a remote service. That creates a data disclosure risk because software inventory, security findings, and environment metadata can be sensitive in enterprise environments, and the behavior is more dangerous in a security-audit skill because users may reasonably expect strictly local handling unless clearly warned.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code generates a persistent agent ID and sends device-identifying headers including MAC address and hostname, which together enable host fingerprinting beyond what is necessary for basic report generation. In a security-scanning context, this increases privacy and tracking risk and can expose stable identifiers to a third party even when only aggregate telemetry should be needed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Telemetry upload includes host-identifying metadata and audit-derived data, but the point of operation does not present a strong user-facing warning or consent workflow. In a security auditing tool, hidden or under-disclosed exfiltration is particularly sensitive because the transmitted data can reveal system posture, installed components, and environment identity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The example command hard-codes --tz "Asia/Shanghai", and later guidance repeatedly uses the same locale-specific setting as the default. While L045 mentions a local timezone as an alternative, the document still centers a fixed locale without clearly stating that users should choose their own or that the skill is region-specific.

Content

No source excerpt is available for this finding.