Back to skill

Security audit

SkillSentryOpenClaw's Always‑On Security Cop

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local security-audit tool, but its UI and documentation can falsely imply protection that is not actually implemented.

Review this before installing as a security control. The CLI audit is local-only, but it can include sensitive matching lines from local memory and skill files in its JSON output. Do not rely on the included panel or documented scheduling/alerting workflow unless the missing backend, config, and reporting components are implemented and the fake clean status is removed.

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
scripts/audit.sh:28
Finding
Recursive Memory Scan Exposes Sensitive Content in JSON Reports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audit.sh`, lines 28–35 and 57 **Vulnerability Type**: Sensitive local data exposure through overbroad scanning and unredacted output **Risk Level**: Medium ### Vulnerable Code ```bash # Prompt-injection pattern scan PI_PATTERNS='(ignore (all|previous) instructions|system prompt|developer message|tool call|jailbreak|do not follow|exfiltrate|leak|override|bypass|prompt injection|function call|tool output|BEGIN PROMPT|END PROMPT)' PI_SCAN_FILE="$TMPDIR/pi_scan.txt" # scan memory + workspace text files (safe, local) SCAN_PATHS=("$WORKDIR/memory" "$WORKDIR/skills" ) >"$PI_SCAN_FILE" for p in "${SCAN_PATHS[@]}"; do if [ -e "$p" ]; then grep -RInE --exclude-dir='.git' --exclude='*.png' --exclude='*.jpg' --exclude='*.jpeg' --exclude='*.gif' --exclude='*.webp' \ "$PI_PATTERNS" "$p" >>"$PI_SCAN_FILE" 2>/dev/null || true fi done ``` ```python "prompt_injection_hits": [l for l in read_file(os.environ["PI_SCAN_FILE"]).splitlines() if l.strip()], ``` ### Technical Analysis The script recursively searches the invoking user's OpenClaw memory and skill directories. Every matching line is copied into a temporary file and then included verbatim in the JSON report. A matching line may contain substantially more information than the detected keyword. For example, a line containing the phrase `system prompt` could also contain private conversation text, credentials, API tokens, internal instructions, filesystem paths, or personal information. The implementation performs no secret detection, redaction, output minimization, file-size restriction, or report-access control. The scan runs with the permissions of the user invoking the script. It does not independently gain elevated operating-system privileges, but it can read all matching files accessible to that account under the selected directories. Because the documented usage redirects stdout to a report file, exposed content can persist after the tem ...[truncated 1616 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Disable memory scanning by default and require explicit user consent for each scan root. 2. Apply least privilege by running the audit under a dedicated account that cannot read unrelated user data or credentials. 3. Return only minimal findings, such as: - Rule identifier - Relative filename - Line number - Redacted or hashed evidence 4. Never include complete matching lines unless an authorized user explicitly enables a diagnostic mode. 5. Add secret-redaction rules for tokens, private keys, passwords, authorization headers, and common credential formats before serialization. 6. Canonicalize and validate scan paths, and enforce an allowlist of approved roots. 7. Exclude symlinks or verify resolved paths so files outside approved roots cannot be scanned indirectly. 8. Restrict file types and maximum file sizes to prevent unnecessary data collection and resource exhaustion. 9. Create reports with restrictive permissions, such as mode `0600`, and define a secure retention policy. 10. Treat report content as untrusted data if it is later supplied to an AI agent or alert-rendering system. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
assets/panel.html:28
Finding
Audit Panel Fabricates a Clean Security Result Without Running the Audit<![CDATA[ ## Vulnerability Details **File Location**: `assets/panel.html`, lines 28–38 **Vulnerability Type**: False security status caused by a hardcoded simulated scan **Risk Level**: High ### Vulnerable Code ```javascript function scan() { document.getElementById('status').innerHTML = 'Status: Scanning...'; log('Running audit.sh...'); setTimeout(() => { log('PI hits: 0 malicious'); log('Gateway: Safe'); document.getElementById('status').innerHTML = 'Status: 🟢 CLEAN'; }, 2000); } ``` ### Technical Analysis The `scan()` function does not invoke `scripts/audit.sh`, contact a backend, read a report, or validate the gateway. After a two-second delay, it unconditionally reports: - Zero malicious prompt-injection hits - A safe gateway - An overall clean status This creates a false-negative security control. The displayed result is unrelated to the actual state of the host, gateway, agent memory, open ports, or audit script execution. Even failures such as a missing shell script, unavailable `openclaw` command, or detected injection indicators cannot alter the panel result. Although the function uses `innerHTML`, the assigned status values are static strings and do not establish a confirmed cross-site scripting vulnerability. The confirmed issue is the fabricated security result. ### Attack Path 1. An OpenClaw installation contains a vulnerable configuration, unexpected local service, or prompt-injection indicator. 2. The user opens the supplied panel and selects `SCAN NOW`. 3. The panel logs `Running audit.sh...`, even though no process is started. 4. After two seconds, the hardcoded callback displays `PI hits: 0 malicious`, `Gateway: Safe`, and `Status: CLEAN`. 5. The user relies on the false status and does not inspect the installation using the actual command-line audit. 6. Existing security issues remain undetected or unremediated. An attacker does not need to modify the panel to trigger this behavior. The unsafe result occurs duri ...[truncated 788 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the hardcoded clean result immediately. 2. Until a working backend exists, clearly label the panel as a nonfunctional demonstration and disable the scan button. 3. Implement an authenticated local backend that: - Starts the audit using a fixed executable and argument list - Does not construct shell commands from browser input - Enforces timeouts and output-size limits - Captures exit status and stderr - Returns structured, validated JSON 4. Bind the backend exclusively to loopback unless remote access is explicitly required. 5. Protect state-changing endpoints against cross-site request forgery and unauthorized local web requests. 6. Generate a unique per-session authorization token rather than trusting localhost alone. 7. Display actual findings, execution timestamps, command failures, and incomplete-scan warnings. 8. Do not display `CLEAN` unless every required check completed successfully and the returned report was validated. 9. Add automated tests proving that known findings, command failures, and malformed reports cannot produce a clean status. 10. Escape report content before rendering it in HTML to prevent future script injection through attacker-controlled scan results. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:21
Finding
Documented Security Workflow Depends on Missing Components<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 21–35 **Vulnerability Type**: Fail-open and misleading security workflow documentation **Risk Level**: Medium ### Vulnerable Documentation ```markdown ## Workflow 1. **Canvas present**: Launch the panel server and present the UI. 2. **User config**: Update `config.yaml` (scan frequency, alerts, sensitivity). 3. **Cron setup**: Schedule `scripts/audit.sh` at the chosen cadence. 4. **Report/Alert**: Review JSON output and alert if prompt-injection hits or unexpected open ports are found. ## Usage ### Panel (recommended) ```bash node scripts/panel-server.js ``` Then present the UI: - `canvas.present` → `http://localhost:8133` (Scan / Settings / Logs) ### Config (CLI) ```bash node scripts/config.js get node scripts/config.js set Scan_freq daily alerts telegram sensitivity high ``` ``` The audited project contains only `scripts/audit.sh` under the `scripts` directory. The documented `scripts/panel-server.js`, `scripts/config.js`, and `config.yaml` are absent. No alerting or report-storage implementation is present in the supplied files. ### Technical Analysis The documentation describes the panel as the recommended workflow and instructs users to run programs that are not included in the package. It also claims configurable scan frequency, Telegram alerts, and a panel server, but the supplied implementation does not provide those capabilities. This is security-relevant because users may believe continuous scans and alerts are configured when they are not. The static HTML panel compounds this problem by simulating a successful scan rather than reporting that its backend is unavailable. No code in the audited package installs a cron task, sends an alert, or starts a panel server. Therefore, this finding does not establish persistence, network transmission, or remote code execution. It establishes a misleading and incomplete security-control implementation. ### Attack Path 1. A user insta ...[truncated 1255 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Either implement and audit every documented component or remove all unsupported claims and commands. 2. If implementing the missing components: - Bind the panel server to `127.0.0.1` by default. - Require a random authorization token. - Validate configuration against a strict schema. - Store configuration and reports with restrictive file permissions. - Invoke the audit without shell interpolation. - Authenticate and protect all state-changing endpoints. - Report scheduling and alert-delivery failures explicitly. 3. Provide an installation-time self-test that verifies required files, executables, directories, and permissions. 4. Make the workflow fail closed: the UI must show `UNAVAILABLE` or `SCAN FAILED` when its backend or report is absent. 5. Clearly distinguish implemented functionality from planned or demonstration functionality. 6. Add integration tests covering panel startup, configuration changes, audit execution, report persistence, scheduling, and alert delivery. 7. Document the exact trust boundaries and data destinations for any future Telegram or other external alert integration. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared purpose and notes say the skill performs local-only security auditing, but the behavior reportedly includes local port scanning while failing to implement some claimed checks such as vulnerabilities or cron validation. This mismatch is dangerous because users may run it with elevated trust, assuming narrow defensive behavior, when it actually performs broader host reconnaissance and may provide a false sense of coverage.

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Content
>"$PI_SCAN_FILE"
for p in "${SCAN_PATHS[@]}"; do
  if [ -e "$p" ]; then
    grep -RInE --exclude-dir='.git' --exclude='*.png' --exclude='*.jpg' --exclude='*.jpeg' --exclude='*.gif' --exclude='*.webp' \
      "$PI_PATTERNS" "$p" >>"$PI_SCAN_FILE" 2>/dev/null || true
  fi
done

# Local port scan (safe, loopback only)
PORT_SCAN_FILE="$TMPDIR/port_scan.txt"
if command -v nmap >/dev/null 2>&1; then
  (nmap -Pn -p 1-1024 127.0.0.1 || true) >"$PORT_SCAN_FILE" 2>&1
else
  echo "nmap not installed" >"$PORT_SCAN_FILE"
fi

# Build JSON report
export TS OPENCLAW_STATUS_FILE GATEWAY_STATUS_FILE SESSION_STATUS_FILE PI_SCAN_FILE PORT_SCAN_FILE
python3 - <<'PY'
import json, os
from pathlib import Path

def read_file(path):
    try:
        return Path(path).read_text(errors='ignore')
    except Exception as e:
        return f"ERROR: {e}"

report = {
    "timestamp": os.environ.get("TS", ""),
    "openclaw_status": read_file(os.environ["OPENCLAW_STATUS_FILE"]),
    "gateway_status": read_file(os.envir
Confidence
70% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill advertises operational behavior that implies access to local files and environment-derived state, but it does not declare any tool scope or permissions boundary. In a security-audit skill, undeclared capability is risky because users may trust it to inspect only expected targets while it can access broader local context without explicit disclosure.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The workflow directs users to modify config.yaml and schedule a cron job, but it does not clearly warn that these are persistent system changes. In a security-themed skill, silent or underexplained persistence is especially concerning because it can normalize ongoing execution and configuration drift without informed user consent.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
The manifest describes a security audit and prompt-injection detector that scans OpenClaw-related status and prompt-injection patterns. Actively probing localhost ports 1-1024 expands into host network reconnaissance, which is not clearly implied by the stated scope and goes beyond inspecting OpenClaw/gateway/cron/PI artifacts.

Static analysis

No suspicious patterns detected.