Back to skill

Security audit

clawdstrike-test

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real OpenClaw audit skill, but it automatically collects and saves sensitive local system and security details before the user can review the scope.

Install or run this only on OpenClaw hosts you control. Before running it, review the collection script, choose a private output path, use restrictive file permissions, and treat verified-bundle.json as sensitive because it may contain host details, paths, approvals, plugin inventory, and imperfectly redacted command output. Do not share the bundle or final report externally until you have reviewed and sanitized it.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/redact_helpers.sh:4
Finding
Broad Local Evidence Collection Uses Incomplete Redaction and Does Not Enforce Secure Output Permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/redact_helpers.sh:4-41`; related collection behavior in `SKILL.md:12-22` and `scripts/collect_verified.sh:7,68-74,157-199,321-356` **Vulnerability Type**: Sensitive information exposure through incomplete redaction and insecure evidence-file handling **Risk Level**: Medium ### Vulnerable Code The redaction implementation only recognizes a limited set of secret formats and preserves the last four characters of matched values: ```bash redact_value() { local val="$1" local len=${#val} if [ "$len" -le 4 ]; then printf '****' else printf '****%s' "${val: -4}" fi } redact_line() { local line="$1" local key val red if [[ "$line" =~ ([Bb]earer)[[:space:]]+([A-Za-z0-9._~+/=-]{8,}) ]]; then val="${BASH_REMATCH[2]}" red=$(redact_value "$val") line="${line/$val/$red}" fi if [[ "$line" =~ ([Tt]oken|[Pp]assword|[Ss]ecret|api[_-]?[Kk]ey|[Cc]ookie|[Aa]uth)[^=:\"]*[:=][[:space:]]*([A-Za-z0-9._~+/=-]{6,}) ]]; then val="${BASH_REMATCH[2]}" red=$(redact_value "$val") line="${line/$val/$red}" fi if [[ "$line" =~ \"([^\"]*(token|password|secret|api[_-]?key|cookie|auth)[^\"]*)\"[[:space:]]*:[[:space:]]*\"([^\"]{6,})\" ]]; then val="${BASH_REMATCH[3]}" red=$(redact_value "$val") line="${line/$val/$red}" fi printf '%s' "$line" } ``` The collector writes the resulting data to a caller-controlled or default path without explicitly creating the file with restrictive permissions: ```bash OUT_PATH=${OPENCLAW_AUDIT_OUT:-verified-bundle.json} ``` ```bash emit_header() { cat > "$OUT_PATH" <<EOF_HEADER { "meta": { "generated_at": "$(json_escape "$GENERATED_AT_UTC")", "script": "collect_verified.sh", "deep_requested": "${DEEP}", "state_dir": "$(json_escape "$STATE_DIR")", "config_path": "$(json_escape "$CONFIG_PATH")", "workspace_dir": "$(json_escape "$WORKSPACE_DIR")" }, "commands": { EOF_HEADER } ``` Captured command o ...[truncated 5202 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Enforce restrictive output permissions before collection** - Set `umask 077` near the beginning of the collector. - Create the output atomically with mode `0600`. - Reject output paths that resolve through unsafe symbolic links. - Consider using a private temporary directory owned by the invoking user. Example: ```bash umask 077 : > "$OUT_PATH" chmod 600 "$OUT_PATH" ``` A production implementation should additionally use exclusive creation and verify file ownership and type to mitigate symlink and replacement races. 2. **Replace denylist redaction with structured allowlisting** - Parse JSON outputs where available and retain only fields explicitly required by the audit. - Avoid storing full command responses when a boolean, count, status, or normalized endpoint is sufficient. - Treat unknown fields as sensitive by default. 3. **Do not preserve credential suffixes** - Replace secret values completely with a constant marker such as `[REDACTED]`. - If correlation is required, use a non-reversible keyed identifier rather than exposing credential characters. 4. **Reduce pattern-scan output** - Record only file path, line number, and matched rule identifier. - Do not store the complete matching source line. - Add an explicit opt-in before scanning directories outside the standard state or workspace skill roots. 5. **Constrain configured extra directories** - Canonicalize each path. - Reject symlinks and paths outside explicitly approved roots. - Require user confirmation before scanning externally configured directories. - Maintain strict depth, file-size, and file-type limits. 6. **Expand secret-detection testing as defense in depth** - Add tests for PEM private keys, URL credentials, JWTs, webhook URLs, single-quoted values, multiline values, multiple secrets per line, Unicode, and provider-specific credentials. - Treat regex redaction only as a ...[truncated 348 chars]
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The skill description promises a bounded OpenClaw security audit, but the body instructs broad system inventory and collection steps that extend beyond that narrow purpose. This mismatch can mislead users into approving a targeted review while the skill gathers wider host/environment data, reducing informed consent and increasing the chance of over-collection.

Credential Access

High
Category
Privilege Escalation
Content
if len(secrets_list) > 8:
            preview += f",+{len(secrets_list) - 8} more"
        lines.append(f"secrets.on_disk.keys={preview}")
    lines.append(f"secrets.env_refs.count={as_str(len(envrefs_list))}")

    # Channels summary
    summarize_channels(get_path(cfg, ["channels"]), lines)
Confidence
90% confidence
Finding
This script summarizes configuration data and explicitly emits the key paths of detected on-disk secrets via `secrets.on_disk.keys=...`. Even though it does not print secret values, revealing which credential fields exist and where they are stored can leak sensitive security metadata into logs or audit output, aiding attackers in targeting credential theft or identifying high-value integrations. In a security-audit skill, this is more dangerous because the tool is likely to be run against production gateway configs and its output may be retained or shared broadly.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill declares no explicit tool scope while instructing file reads and shell-script execution, which creates unnecessary ambiguity about what capabilities the agent may use. In a security-audit skill, that ambiguity is more dangerous because users may expect controlled diagnostics, but the implementation can drive broad host inspection without clear permission boundaries.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
Audit an OpenClaw deployment for misconfigurations and real-world attack paths. Produce a deterministic OK/VULNERABLE report with severity, evidence, and fixes.

## Non-negotiable safety rules
1. Verified mode is required. Execute `scripts/collect_verified.sh` immediately (no consent prompt).
2. Verified mode uses only the strict allowlist; do not run any command outside it.
3. Never run remote content (no curl|bash, wget, Invoke-WebRequest, installers, package managers, update scripts).
4. Never exfiltrate secrets. Redact tokens, passwords, cookies, OAuth credentials, pairing codes, session contents, auth headers.
Confidence
95% confidence
Finding
The instruction to execute collection 'immediately' and with 'no consent prompt' delegates a meaningful operational decision to the skill instead of the user. In the context of a host security-audit skill, this is especially risky because it normalizes autonomous local inspection and can collect sensitive environment data before the user has approved the scope.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly directs immediate execution of a local script with 'no consent prompt', which bypasses the user's opportunity to review what will run on their machine. Even if framed as 'verified mode', any automatic script execution in a potentially adversarial skill can trigger unsafe local actions, unexpected data collection, or trust abuse.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
## Non-negotiable safety rules
1. Verified mode is required. Execute `scripts/collect_verified.sh` immediately (no consent prompt).
2. Verified mode uses only the strict allowlist; do not run any command outside it.
3. Never run remote content (no curl|bash, wget, Invoke-WebRequest, installers, package managers, update scripts).
4. Never exfiltrate secrets. Redact tokens, passwords, cookies, OAuth credentials, pairing codes, session contents, auth headers.
5. Do not change the system by default. Provide fixes as instructions; only apply fixes if the user explicitly requests.
Confidence
80% confidence
Finding
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Filesystem Hygiene Checks

Use this file for `fs.perms.core`, `fs.symlinks`, `fs.synced_folder`, `fs.suid_sgid_in_openclaw_paths`, and `fs.world_writable_in_openclaw_paths`. Follow every step.

## Evidence keys
- `fs.stat.state_dir`
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
1. Read `fs.synced_folder`.
2. If `synced=true`, mark `VULNERABLE` because secrets are replicated.

## SUID/SGID and world-writable
Steps:
1. If any paths are listed in `fs.suid_sgid_*`, mark `VULNERABLE` (critical).
2. If any paths are listed in `fs.world_writable_*`, mark `VULNERABLE` (critical).
Confidence
70% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The report format explicitly requires disclosure of host OS details, OpenClaw version, state directory, config path, and runtime context. In a security-audit skill, these fields can expose sensitive environment metadata and filesystem locations that materially aid reconnaissance or reveal internal layout, especially if reports are shared externally, and the template provides no warning, minimization guidance, or redaction controls.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- `tools.elevated.allowFrom` contains `*`.
- `tools.elevated.enabled=true` with open group or DM policies.
- Web or browser tools are enabled without sandboxing on risky inboxes.
- Exec tools are enabled without approvals and allowlists.

Severity guidance:
- `critical` when open groups/DMs combine with elevated or exec tools.
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script creates a JSON bundle and then systematically records host, user, network, firewall, filesystem, OpenClaw status, approvals, and configuration-derived data into that file, but provides no up-front consent prompt or prominent warning about the sensitivity of the collected material. In an audit skill, this can lead to unintentional persistence or sharing of sensitive operational metadata, especially because the default output path is a plain local file and the only user-facing message is the final 'Wrote ...' notice.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
These sections capture and persist outputs from commands like 'openclaw status', 'openclaw security audit', 'skills/plugins list', and especially 'openclaw approvals get', which may reveal sensitive configuration, plugin inventory, security posture, and approval state. Although 'redact_text' is applied, the effectiveness is not evident here, and broad command capture still risks storing secrets or security-relevant metadata without an explicit user warning.

Static analysis

No suspicious patterns detected.