Back to skill

Security audit

Agent Safety

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed local safety scanner, but its persistent Git hook installer has a command-injection flaw and other enforcement gaps that warrant review before installation.

Install only after reviewing or fixing the hook installer. The main risk is not hidden exfiltration, but a persistent Git hook generated with unsafe shell templating and scanner bypasses that can miss files or allow some PII through as warnings. Treat the health check as a local system/workspace audit that may contact npm for version information.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pre-publish-scan.sh:29
Finding

Filename word splitting allows files to bypass security scanning

Content
View full analysis
/dev/null) else FILES="$TARGET" fi for f in $FILES; do SCANNED=$((SCANNED + 1)) CONTENT=$(cat "$f" 2>/dev/null || continue) ``` The generated pre-commit hook contains the same unsafe pattern: ```bash # scripts/install-hook.sh:42-55 STAGED=$(git diff --cached --name-only --diff-filter=ACM) if [ -z "$STAGED" ]; then exit 0 fi TMPDIR=$(mktemp -d) trap 'rm -rf "$TMPDIR"' EXIT FAIL=0 for f in $STAGED; do mkdir -p "$TMPDIR/$(dirname "$f")" git show ":$f" > "$TMPDIR/$f" 2>/dev/null || continue done ``` ### Technical Analysis The scripts serialize filename lists into scalar shell variables and subsequently iterate over them using unquoted expansions. Bash applies word splitting and pathname expansion to `$FILES` and `$STAGED`. A filename containing spaces, tabs, newlines, or shell glob characters can therefore be divided into multiple unrelated path components or expanded against files in the current directory. In the pre-commit hook, a failed `git show ":$f"` operation is silently ignored through `|| continue`, so omitted staged files do not cause the commit to fail. This defect undermines the primary security guarantee of the project: that all staged content is scanned before a commit is accepted. ### Attack Path 1. An attacker or repository contributor creates a file whose name contains whitespace or another filename metacharacter. 2. The attacker places a credential, ...[truncated 1186 chars]
Remediation
View remediation
/dev/null || continue) # Perform checks here. done < <( find "$TARGET" -type f \ ! -path '*/.git/*' \ ! -path '*/node_modules/*' \ ! -name '*.png' ! -name '*.jpg' ! -name '*.gif' \ ! -name '*.ico' ! -name '*.woff*' ! -name '*.ttf' \ ! -name '*.zip' ! -name '*.tar*' ! -name '*.gz' \ -print0 2>/dev/null ) ``` For staged Git paths: ```bash while IFS= read -r -d '' f; do mkdir -p -- "$TMPDIR/$(dirname -- "$f")" if ! git show ":$f" > "$TMPDIR/$f"; then echo "Failed to extract staged file: $f" >&2 exit 1 fi done < <(git diff --cached --name-only --diff-filter=ACM -z) ``` Additional hardening should include: - Use `--` where supported to prevent paths beginning with `-` from being interpreted as options. - Fail closed when staged content cannot be extracted. - Add tests for spaces, tabs, newlines, wildcard characters, leading hyphens, and non-ASCII filenames. - Avoid storing filename lists in scalar shell variables. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pre-publish-scan.sh:100
Finding

Detected PII does not block publication despite documented enforcement

Content
View full analysis
/dev/null; then note "$f — Public IP address(es) found — verify intended" fi # Physical addresses (street patterns) if echo "$CONTENT" | grep -qEi '\d{1,5}\s+(N|S|E|W|North|South|East|West)?\s*\w+\s+(St|Ave|Blvd|Dr|Rd|Ln|Way|Ct|Pl|Cir)\.?\b'; then note "$f — Possible physical address — verify not personal" fi # SSN pattern if echo "$CONTENT" | grep -qE '\b\d{3}-\d{2}-\d{4}\b'; then warn "$f — Possible SSN detected" fi # Credit card patterns if echo "$CONTENT" | grep -qE '\b[0-9]{4}[- ]?[0-9]{4}[- ]?[0-9]{4}[- ]?[0-9]{4}\b'; then note "$f — Possible credit card number — ...[truncated 2177 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install-hook.sh:66
Finding

Unescaped scanner path can inject commands into the generated Git hook

Content
View full analysis
Remediation
View remediation
"$HOOK" <
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description claims outbound secret/PII scanning and git commit protection, but the detected behavior includes broader system and workspace inspection unrelated to that narrow purpose. This mismatch is dangerous because users or agents may grant trust and execute the skill expecting a safety scanner, while it performs additional local enumeration of system state and files beyond the advertised mission.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
if ! bash "$SCAN_SCRIPT" "$TMPDIR"; then
  echo ""
  echo "❌ Commit blocked. Fix issues above before committing."
  echo "   To bypass (emergencies only): git commit --no-verify"
  exit 1
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/install-hook.sh (reported line 63)May include surrounding context.

sh
if ! bash "$SCAN_SCRIPT" "$TMPDIR"; then
  echo ""
  echo "❌ Commit blocked. Fix issues above before committing."
  echo "   To bypass (emergencies only): git commit --no-verify"
  exit 1
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/install-hook.sh (reported line 80)May include surrounding context.

sh
if ! bash "$SCAN_SCRIPT" "$TMPDIR"; then
  echo ""
  echo "❌ Commit blocked. Fix issues above before committing."
  echo "   To bypass (emergencies only): git commit --no-verify"
  exit 1
fi

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/pre-publish-scan.sh (reported line 87)May include surrounding context.

sh
warn "$f — Possible hardcoded password"
  fi

  # .env style secrets
  if echo "$CONTENT" | grep -qEi '^[A-Z_]*(SECRET|TOKEN|KEY|PASSWORD|CREDENTIAL)[A-Z_]*\s*=\s*[^\s]{8,}'; then
    warn "$f — Environment variable with secret value"
  fi

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

High
Category
YARA Match
Confidence
70% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/pre-publish-scan.sh (reported line 148)May include surrounding context.

sh
-Z0-9_]+/'; then
    note "$f — Home directory path found — may reveal username"
  fi

  # OpenClaw internal paths
  if echo "$CONTENT" | grep -qE '\.openclaw/(config|workspace)'; then
    note "$f — OpenClaw internal path — verify intended"
  fi

  # --- DANGEROUS CODE PATTERNS ---

  # Exfiltration endpoints
  if echo "$CONTENT" | grep -qiE '(webhook\.site|ngrok\.io|pipedream|requestbin|burpcollaborator|interact\.sh|oastify)'; then
    warn "$f — Known exfiltration endpoint detected"
  fi

  # Reverse shell patterns
  if echo "$CONTENT" | grep -qE '(mkfifo|/dev/tcp/|ncat\s.*-e|nc\s.*-e)'; then
    warn "$f — Possible reverse shell pattern"
  fi

  # Bulk env harvesting
  if echo "$CONTENT" | grep -qE '(\$\{!.*@\}|printenv\s*$|printenv\s*\|)'; then
    warn "$f — Bulk environment variable harvesting"
  fi

  # Code obfuscation
  if echo "$CONTENT" | grep -qE '(eval\s*\(.*base64|atob\s*\(|Buffer\.from\s*\(.*(base64|hex))'; then
    note "$f — Possible code obfuscation �

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/pre-publish-scan.sh (reported line 168)May include surrounding context.

sh
fi

  # Path traversal
  if echo "$CONTENT" | grep -qE '(\.\./\.\./|/etc/passwd|/etc/shadow|~\/\.ssh|~\/\.aws)'; then
    warn "$f — Path traversal or sensitive file access pattern"
  fi

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/pre-publish-scan.sh (reported line 168)May include surrounding context.

sh
fi

  # Path traversal
  if echo "$CONTENT" | grep -qE '(\.\./\.\./|/etc/passwd|/etc/shadow|~\/\.ssh|~\/\.aws)'; then
    warn "$f — Path traversal or sensitive file access pattern"
  fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises and invokes shell scripts but does not declare any explicit tool scope or permissions boundary. In an agent setting, undeclared shell capability increases the chance of overbroad execution, making it harder to reason about what the skill may access or modify and weakening policy enforcement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a skill focused on scanning agent output and enforcing secret/PII blocking at commit time, with periodic system health checks as a secondary use case. Querying npm for the latest OpenClaw version is a networked update-check behavior that is not part of outbound content scanning and goes beyond the described safety-enforcement role.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest centers on preventing accidental publication of secrets from agent output and git commits. Checking for macOS updates is a broader host-maintenance function that does not directly implement outbound safety scanning, creating a semantic mismatch between the advertised purpose and actual behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest promises protection against accidentally publishing secrets via agent output and git operations. Auditing firewall and System Integrity Protection status is host security posture assessment, not outbound-content enforcement, so the code does more than the description suggests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script performs npm view openclaw version, which makes a network request to an external registry. Although the script prints the resulting version information, it does not explicitly disclose before or in comments that running the health check contacts an external service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated hook comment says 'Auto-installed by github-publish skill', but the manifest and surrounding script clearly implement an agent-safety pre-commit scanner. This is an active documentation contradiction about the tool's identity and intent, which could mislead users auditing what installed the hook.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.