Back to skill

Security audit

security-audit-assistant

Security checks for vulnerabilities and agentic risk

Overview

This skill is not clearly malicious, but it needs review because it requests managed-node and cron authority while shipping an incomplete scanner and unsafe root-level fix guidance.

Install only if you are comfortable granting managed-node execution and cron-related authority. Treat its audit results as unreliable until the mock executor is replaced with real OpenClaw node execution, and do not run the suggested sudo fixes on production systems without reviewing them, making backups, validating SSH and firewall changes, and planning rollback access.

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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
HOOK.md:9
Finding
Unused Cron Permission Violates Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `HOOK.md:9-11` **Vulnerability Type**: Excessive system permission **Risk Level**: Medium ### Vulnerable Code ```yaml permissions: - node:exec - system:cron ``` ### Technical Analysis The Skill requests the `system:cron` permission even though `scripts/audit.js` does not use a cron API or register a scheduled task. The documented weekly audit is instead created through a command that users manually run. The `node:exec` capability is consistent with the declared host-auditing functionality, but direct cron access is unnecessary for the current implementation. It introduces a cross-session persistence capability beyond the minimum privileges required to run an on-demand security scan. No evidence was found that the current code automatically abuses this permission or creates a hidden scheduled task. The issue is the unnecessary availability of a persistence primitive if the Skill or its execution path is subsequently modified or compromised. ### Attack Path 1. A user installs the Skill and grants all permissions declared in `HOOK.md`. 2. The Skill receives `system:cron` access despite not requiring it for the implemented scanner. 3. An attacker compromises or replaces the Skill entry point, or a future update introduces malicious behavior. 4. The altered code uses the already granted cron capability to register a recurring command. 5. The command continues to execute after the original Skill run completes. ### Impact Assessment A compromised Skill could potentially establish recurring execution under the privilege level provided by the OpenClaw cron subsystem. The resulting scope depends on the runtime identity and cron API restrictions, but it may include persistent access to managed-node operations. There is no evidence that the current version actually performs this attack. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `system:cron` from the manifest: ```yaml permissions: - node:exec ``` 2. Continue documenting scheduling as a separate, explicit user action if direct scheduling is not required. 3. If in-Skill scheduling is implemented later, request the permission only when the user enables that feature. 4. Before registration, display the exact schedule, command, execution identity, output destination, and removal procedure. 5. Require explicit confirmation and provide a command or interface for listing and deleting the resulting scheduled task. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit.js:17
Finding
Unsafe Root-Level Remediation Commands Can Cause Persistent System Changes<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audit.js:17, 26, 35, 45, 54, 63, 72, 81, 90, 99, 108` **Vulnerability Type**: Unsafe privileged remediation guidance **Risk Level**: Medium ### Vulnerable Code ```js fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd", fix: "sudo sed -i 's/PermitRootLogin yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd", fix: "sudo ufw enable && sudo ufw default deny incoming", fix: "sudo systemctl enable --now firewalld && sudo firewall-cmd --set-default-zone=drop", fix: "sudo apt update && sudo apt upgrade -y", fix: "sudo sed -i 's/^#*PASS_MAX_DAYS.*/PASS_MAX_DAYS 90/' /etc/login.defs", fix: "sudo apt install auditd audispd-plugins -y && sudo systemctl enable --now auditd", fix: "sudo systemctl enable --now rsyslog", fix: "sudo sed -i 's/^Protocol.*/Protocol 2/' /etc/ssh/sshd_config && sudo systemctl restart sshd", fix: "sudo chmod 644 /etc/passwd", fix: "sudo chmod 640 /etc/shadow", ``` ### Technical Analysis The generated report presents copy-ready commands that use `sudo` to modify SSH configuration, firewall policy, package state, password policy, file permissions, and persistent service state. The commands do not include configuration backups, preflight validation, connectivity safeguards, environment-specific checks, or rollback procedures. In particular: - SSH configuration is changed and the daemon restarted without first running a syntax check such as `sshd -t`. - Enabling UFW or assigning firewalld's default zone to `drop` can terminate remote management access if required ports and interfaces have not first been allowed. - `apt upgrade -y` applies broad unattended package changes rather than limiting remediation to verified security updates. - `systemctl enable --now` persists firewall and logging services across reboots. - Hard-coded permission expectations may not be correct for every supported distribution or authentication con ...[truncated 1331 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Clearly identify remediation commands as examples requiring administrator review rather than guaranteed one-click fixes. 2. Require explicit confirmation before executing or recommending persistent changes. 3. Back up configuration files before editing them and provide tested rollback commands. 4. Validate SSH changes with `sshd -t` before restarting or reloading the daemon. 5. Detect the correct SSH service name and prefer a safe reload where supported. 6. Before enabling a default-deny firewall policy, identify the active management connection and explicitly permit required SSH and application ports. 7. Confirm the operating system, package manager, installed firewall implementation, and service availability before generating a command. 8. Avoid broad unattended upgrades by default; distinguish security updates from general package upgrades. 9. Explain that `systemctl enable` creates a persistent boot-time change and obtain separate confirmation for it. 10. Treat collection failures as `UNKNOWN` or `ERROR` and do not offer remediation until the underlying state is verified. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit.js:114
Finding
Mock Command Executor Produces False Audit Results<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audit.js:114-139` **Vulnerability Type**: Fail-unsafe security scanner implementation **Risk Level**: Medium ### Vulnerable Code ```js // Mock node.exec for local testing (OpenClaw provides real one) async function runCommand(cmd) { // In real execution, this uses OpenClaw's node.exec API // For now, simulate success return { stdout: '', stderr: '', code: 0 }; } async function auditNode(nodeInfo) { const results = []; const os = await detectOS(); for (const check of checks) { if (!check.os.includes(os)) continue; const { stdout } = await runCommand(check.command); const passed = stdout.trim() === check.expected || (check.expected === 'none' && stdout === 'none'); results.push({ ...check, passed, actual: stdout.trim(), recommendation: passed ? null : check.fix }); } return { node: nodeInfo.name, os, results }; } async function detectOS() { const { stdout } = await runCommand('cat /etc/os-release | grep ^ID= | cut -d= -f2 | tr -d \'"\''); const id = stdout.trim(); if (id.includes('ubuntu') || id.includes('debian')) return 'ubuntu'; if (id.includes('centos') || id.includes('rhel')) return 'centos'; return 'unknown'; } ``` ### Technical Analysis `runCommand()` does not call OpenClaw's `node.exec` interface. It always returns an empty standard-output string with exit code zero. Therefore, the scanner does not inspect the target host. The audit logic treats output mismatches as security failures rather than distinguishing failed collection from a confirmed insecure state. It also discards `stderr` and does not evaluate the command exit code. If a supported OS were supplied through a real or partially modified detection path, empty output would cause applicable checks to fail and privileged remediation commands to be displayed regardless of the host's actual configuration. In the exact current implementation, `detectOS()` also ...[truncated 1511 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the mock executor with the documented OpenClaw `node.exec` integration before release. 2. Keep mock behavior only in isolated test code that cannot be selected in production. 3. Validate and retain `stdout`, `stderr`, exit code, timeout status, and execution errors. 4. Introduce separate result states such as `PASS`, `FAIL`, `UNKNOWN`, `NOT_APPLICABLE`, and `ERROR`. 5. Never report “all checks passed” when zero checks ran or OS detection failed. 6. Suppress remediation commands when evidence collection is incomplete. 7. Add unit and integration tests for supported operating systems, command failures, unexpected output, missing services, and permission-denied responses. 8. Verify that the advertised `--all`, `--node`, and `--format` options are implemented before documenting them as supported. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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
Findings (42)

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
95% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
95% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
95% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Passwords | Password aging enabled, no default accounts | Medium |
| Services | Unnecessary services disabled (telnet, vsftpd) | Low |
| Logging | Auditd/rsyslog enabled and rotating | Medium |
| File Permissions | /etc/passwd, /etc/shadow correct perms | High |

**Total checks**: ~20 per node
Confidence
95% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Chaining Abuse

High
Category
Tool Misuse
Content
❌ HIGH RISK:
1. SSH password authentication is ENABLED
   Fix: sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd

⚠️  MEDIUM:
2. Security updates available (5 packages)
Confidence
80% confidence
Finding
The chained command edits sshd_config and immediately restarts SSH with root privileges, increasing the chance of an operator executing multiple impactful actions without intermediate validation. If the edit is incorrect or environment-specific, the restart can break remote access and cause immediate administrative lockout.

Ae1

High
Category
analysis-evasion
Content
- **Script**: `scripts/audit.js` (~150 lines, Node.js)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The file header claims the script performs baseline security checks, but the only command runner is a stub that never executes any real checks. In a security-audit skill, this is dangerous because it can produce misleading reports and create false assurance that a node was assessed when it was not.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill advertises 'one-click fix commands' and automated scheduling for security changes without clearly warning users to review commands first or consider service impact. In a system-administration context, this can lead operators to run privileged remediation blindly, causing outages, lockouts, or unintended configuration drift.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The sample output includes direct system-modifying commands such as editing sshd_config, restarting SSH, and upgrading packages, but provides no caution about access loss, package side effects, or maintenance windows. Because the skill targets admins and small teams, users may treat the examples as safe defaults and apply them without validation.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
⚠️  MEDIUM:
2. Security updates available (5 packages)
   Fix: sudo apt update && sudo apt upgrade -y

✅ All checks completed in 8 seconds.
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
risk: 'high',
    command: 'grep -E "^PasswordAuthentication" /etc/ssh/sshd_config | awk \'{print $2}\'',
    expected: 'no',
    fix: "sudo sed -i 's/PasswordAuthentication yes/no/' /etc/ssh/sshd_config && sudo systemctl restart sshd",
    os: ['ubuntu', 'debian', 'centos']
  },
  {
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.