Back to skill

Security audit

Skill Audit Guardian

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent security-auditing purpose, but its watcher runs hard-coded scripts outside the reviewed package and its ZIP handling is under-contained for untrusted archives.

Review before installing. Run only in an isolated workspace with disposable ZIP inputs, and do not use the watcher unless the hard-coded script paths are replaced with package-relative paths. Prefer a version that validates archive entries, uses mktemp with restrictive permissions, limits extraction size/count, and makes output paths configurable.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/skill-zip-audit.sh:28
Finding
Untrusted ZIP Archives Are Extracted into a Predictable Shared Temporary Directory<![CDATA[ ## Vulnerability Details **File Location**: `scripts/skill-zip-audit.sh`, lines 28-34 **Vulnerability Type**: Unsafe temporary directory and archive extraction **Risk Level**: Medium ### Vulnerable Code ```bash TS="$(date +%Y%m%d-%H%M%S)" NAME="$(basename "$ZIP_PATH" .zip)" BASE="/tmp/skill-audit/${NAME}-${TS}" SRC_DIR="$BASE/src" mkdir -p "$SRC_DIR" unzip -qq "$ZIP_PATH" -d "$SRC_DIR" ``` ### Technical Analysis The script extracts an untrusted archive directly into a predictable location under the shared `/tmp` directory. The destination is derived from the archive name and a timestamp with one-second precision rather than being created atomically using a facility such as `mktemp`. The implementation does not: - Ensure that the audit directory is newly and atomically created. - Set restrictive permissions on the audit directory. - Reject pre-existing directories or symbolic links in the destination path. - Preflight archive entries for unsafe paths or symbolic links. - Limit the number, depth, or total expanded size of archive entries. - Apply a timeout or filesystem quota during extraction. A second local process may predict or observe the destination and pre-create components of the path. Depending on filesystem permissions and link placement, later report writes could then be redirected or disrupted. Independently, a malicious archive can contain a very large expanded payload or excessive numbers of files, causing disk-space or inode exhaustion. Archive traversal and symbolic-link behavior also depends on the installed `unzip` implementation. The script should not assume that every supported implementation safely handles every hostile archive layout. ### Attack Path 1. An attacker supplies a crafted ZIP file for auditing or places it in the watched drop directory. 2. The auditor derives a predictable path such as `/tmp/skill-audit/example-20260910-120000`. 3. A local attacker may pre-create that path or selected path components before `m ...[truncated 1078 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create the audit directory atomically with restrictive permissions: ```bash umask 077 BASE="$(mktemp -d "${TMPDIR:-/tmp}/skill-audit.XXXXXXXX")" SRC_DIR="$BASE/src" mkdir -m 700 "$SRC_DIR" ``` 2. Reject archives containing absolute paths, parent-directory traversal components, symbolic links, hard links, excessive nesting, or other unsupported entry types before extraction. 3. Enforce limits on: - Compressed and expanded size. - Number of entries. - Maximum individual file size. - Directory depth. - Extraction duration. 4. Perform extraction in an isolated environment with no network access and access only to the input archive and dedicated output directory. 5. Verify after extraction that every regular output path resolves beneath the canonical extraction root. 6. Avoid reusing an existing audit directory and ensure cleanup is performed safely without following symbolic links. ]]>

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/skill-zip-watch.sh:5
Finding
Watcher Executes Hard-Coded Scripts Outside the Reviewed Package<![CDATA[ ## Vulnerability Details **File Location**: `scripts/skill-zip-watch.sh`, lines 5-6, 64, and 79-82 **Vulnerability Type**: External tool substitution through hard-coded executable paths **Risk Level**: Medium ### Vulnerable Code ```bash AUDIT_SCRIPT="/Users/gascomp/.openclaw/workspace/scripts/skill-zip-audit.sh" DASH_SCRIPT="/Users/gascomp/.openclaw/workspace/scripts/generate-skill-audit-pro.py" ``` ```bash audit_output="$($AUDIT_SCRIPT "$z" 2>&1)" ``` ```bash # refresh dashboard after each successful audit if [[ -x "$DASH_SCRIPT" ]]; then set +e "$DASH_SCRIPT" >> "$LOG_FILE" 2>&1 set -e fi ``` ### Technical Analysis The watcher does not execute the auditor and dashboard generator shipped relative to its own installed directory. Instead, it trusts fixed absolute paths belonging to a specific developer environment. Consequently, the code that executes at runtime may differ from the code contained in and reviewed as part of this Skill. The dashboard path receives an executable-file check, but that check does not validate ownership, integrity, regular-file status, or whether the path resolves through attacker-controlled symbolic links. The audit script is invoked without even the executable check. This creates a tool-substitution boundary: any party capable of writing to either hard-coded file or replacing a writable parent path can cause the watcher to execute substituted code. It also makes the published package non-portable and likely to fail on systems where the developer-specific paths do not exist. ### Attack Path 1. The Skill is run on a system where the hard-coded path exists or can be created. 2. An attacker who has write access to the target script, a writable parent directory, or a replaceable symbolic-link component installs a malicious executable at one of the trusted paths. 3. The user starts `skill-zip-watch.sh` and places a ZIP file in the watched directory. 4. The watcher invokes the substituted audit script while processi ...[truncated 1050 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Resolve both scripts relative to the watcher itself: ```bash SCRIPT_DIR="$( cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )" AUDIT_SCRIPT="$SCRIPT_DIR/skill-zip-audit.sh" DASH_SCRIPT="$SCRIPT_DIR/generate-skill-audit-pro.py" ``` 2. Validate each target before execution: ```bash [[ -f "$AUDIT_SCRIPT" && ! -L "$AUDIT_SCRIPT" && -x "$AUDIT_SCRIPT" ]] || exit 1 [[ -f "$DASH_SCRIPT" && ! -L "$DASH_SCRIPT" && -x "$DASH_SCRIPT" ]] || exit 1 ``` 3. Ensure the installation directory and scripts are not writable by untrusted users. 4. Canonicalize paths and verify that both resolved executables remain inside the expected package directory. 5. Where package integrity metadata is available, verify file hashes or signatures before execution. 6. Remove developer-specific absolute paths from the distributable package and fail closed if the bundled scripts cannot be validated. ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Ae1

High
Category
analysis-evasion
Content
- `scripts/skill-zip-watch.sh`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `scripts/skill-zip-watch.sh`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `scripts/generate-skill-audit-pro.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises and documents shell execution plus file read/write behavior, but it does not declare an explicit tool scope such as permissions or allowed-tools. That mismatch weakens trust boundaries and reviewability, because a user or platform may not be clearly informed that the skill can inspect ZIP contents, generate files, and move files on disk.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation promotes a continuous watch mode that automatically sorts files into risk folders, but it does not prominently warn that user files will be moved as a side effect. This can cause unintended file manipulation, confusion, or operational disruption, especially if a user runs it on a broad or sensitive directory expecting read-only analysis.

Description-Behavior Mismatch

Low
Confidence
83% confidence
Finding
The manifest describes auditing skill ZIPs, classifying risk, auto-sorting files, and generating a security dashboard. This script specifically writes the dashboard to a hard-coded local path on a particular user's Desktop, which is an additional concrete filesystem side effect not conveyed by the description and narrower than a generic dashboard-generation claim.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script is configured to write output to /Users/gascomp/Desktop/skill-audit-pro.html, which is a file write affecting the local filesystem. In this file there is no confirmation prompt, user-facing log before the write, docstring, or comment explaining that behavior; the only print happens after the write completes.

Missing User Warnings

Low
Confidence
69% confidence
Finding
The script scans /tmp/skill-audit/*/report.md and suspicious.txt files, which may contain user or system audit data. The code does not include any visible warning, docstring, or comment informing the user that local audit artifacts will be collected and incorporated into the generated report.