Back to skill

Security audit

OpenClaw Bug Report

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed OpenClaw troubleshooting helper that gathers local diagnostics and drafts a GitHub issue only with user review, with one local privacy precaution users should understand.

Install only if you are comfortable letting it collect local OpenClaw diagnostics. Review every generated file before sharing, do not attach the full bundle publicly, and write the output into a private directory because the script does not force restrictive file permissions.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/collect-openclaw-diagnostics.sh:97
Finding

Diagnostics Bundle Uses Inherited and Potentially Permissive Filesystem Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/collect-openclaw-diagnostics.sh, lines 97-113
Vulnerability Type: Sensitive diagnostic data stored without explicit restrictive permissions
Risk Level: Medium

bash
if [ -z "$OUTPUT_DIR" ]; then
  OUTPUT_DIR="./openclaw-diagnostics-$(date -u +%Y%m%dT%H%M%SZ)"
fi

if [ -e "$OUTPUT_DIR" ] && [ ! -d "$OUTPUT_DIR" ]; then
  echo "Output path exists but is not a directory: $OUTPUT_DIR" >&2
  exit 1
fi
if ! mkdir -p "$OUTPUT_DIR"/{commands,configs,logs,plugins}; then
  echo "Could not create diagnostics output directory: $OUTPUT_DIR" >&2
  exit 1
fi
COMMAND_INDEX="$OUTPUT_DIR/commands/command-index.tsv"
FILE_INDEX="$OUTPUT_DIR/file-index.tsv"
if ! printf 'name\tstatus\toutput\n' > "$COMMAND_INDEX"; then
  echo "Could not write command index: $COMMAND_INDEX" >&2
  exit 1
fi

Technical Analysis

The collector creates directories and files without setting a restrictive umask or explicitly assigning private permissions. Their effective permissions therefore depend on the caller's inherited process environment. With a common umask of 022, generated directories are normally created with mode 0755 and files with mode 0644.

The resulting bundle can contain operating-system details, OpenClaw status output, configuration metadata, plugin information, service state, and recent log excerpts. When optional flags are enabled, it can also contain redacted configuration contents and Git remote details. Although the script applies pattern-based redaction, such redaction cannot reliably recognize every proprietary credential format, personal identifier, conversation fragment, or application-specific secret.

The script also accepts an existing directory as OUTPUT_DIR without verifying its owner, permissions, or whether path components are symbolic links. This increases the risk when a user selects a shared or attacker- ...[truncated 1681 chars]

Remediation
View remediation

Remediation Suggestions

  1. Set a restrictive mask before creating any output:
    bash
    umask 077
    
  2. Create the top-level output directory with mode 0700 and generated files with mode 0600.
  3. Refuse an existing output directory unless it is owned by the current effective user and is not accessible by group or other users.
  4. Resolve and validate the output path before writing. Reject symbolic-link output directories and unsafe parent directories.
  5. Create a new directory atomically rather than reusing a potentially attacker-controlled directory.
  6. Retain the existing redaction and manual-review controls, but state clearly that they do not replace access controls.
  7. Offer an explicit cleanup command or approved automatic deletion workflow for diagnostics that the user elects not to share.

other

Note
Location
scripts/collect-openclaw-diagnostics.sh:376
Finding

Diagnostics Collector Produces a Concentrated Local Environment Reconnaissance Artifact

Content
View full analysis

Vulnerability Details

File Location: scripts/collect-openclaw-diagnostics.sh, lines 376-406; additional collection at lines 408-516
Vulnerability Type: Broad environment and application reconnaissance
Risk Level: Low

bash
run_cmd system-uname uname -a
write_env_summary

if command -v sw_vers >/dev/null 2>&1; then
  run_cmd system-macos sw_vers
fi
if command -v node >/dev/null 2>&1; then
  run_cmd node-version node --version
fi
if command -v npm >/dev/null 2>&1; then
  run_cmd npm-version npm --version
fi
if command -v pnpm >/dev/null 2>&1; then
  run_cmd pnpm-version pnpm --version
fi
write_git_summary

if command -v openclaw >/dev/null 2>&1; then
  run_cmd openclaw-version openclaw --version
  run_cmd openclaw-status openclaw status
  run_cmd openclaw-gateway-status-deep openclaw gateway status --deep
  run_cmd openclaw-plugins-list openclaw plugins list
  run_cmd openclaw-plugins-list-json openclaw plugins list --json
  run_cmd openclaw-config-file openclaw config file
  run_cmd openclaw-config-validate openclaw config validate
else
  echo "openclaw command not found on PATH." > "$OUTPUT_DIR/commands/openclaw-not-found.txt"
  printf '%s\t%s\t%s\n' "openclaw-not-found" "127" "commands/openclaw-not-found.txt" >> "$COMMAND_INDEX"
fi

The subsequent code also searches OpenClaw and workspace configuration files, inventories plugin and skill manifests, tails recent logs, and queries existing user-service state through systemctl or launchctl.

Technical Analysis

The collector intentionally performs broad host and application discovery. It records operating-system information, language and package-manager versions, environment-variable presence, Git state, OpenClaw status, gateway details, plugins, configuration metadata, recent logs, and service status.

This behavior is consistent with the documented dia ...[truncated 2546 chars]

Remediation
View remediation

Remediation Suggestions

  1. Present a collection plan before execution and list every data category that will be gathered.
  2. Make nonessential categories separately opt-in, particularly Git details, service status, plugin inventories, and log collection.
  3. Collect only the minimum information needed for the reported symptom instead of always running the complete command set.
  4. Keep private configuration and temporary-log collection disabled by default.
  5. Store all output with mode 0600 inside a mode 0700 directory.
  6. Add an automated final scan that flags high-entropy values, URLs containing credentials, private keys, tokens, cookies, and unrecognized authorization fields.
  7. Generate a separate minimal public-report directory containing only explicitly selected excerpts.
  8. Prevent or prominently warn against attaching the complete diagnostics directory.
  9. Support secure deletion of bundles that are rejected or no longer required.
Vulnerability Patterns
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
- Default to draft-only public output until the user approves the final issue body after diagnostics collection.
- Never attach the full diagnostics bundle to a public issue; quote only necessary redacted excerpts.
- Redact usernames, emails, organization names, hostnames, and absolute home paths when they are not necessary for debugging.
- Do not restart services, disable plugins, edit config, or delete state unless the user explicitly approves that action.
- Mark evidence as "observed" and hypotheses as "suspected." Do not overclaim root cause from a symptom report.

## Resources

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/collect-openclaw-diagnostics.sh`: Best-effort local collector for conservative system, OpenClaw, plugin, config-metadata, and log evidence. Requires

Static analysis

No suspicious patterns detected.