Back to skill

Security audit

Workspace Organization - Automated Health Checks

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed local workspace audit and setup helper; its main risks are local path exposure in logs and possible overwrites when running setup, not hidden or malicious behavior.

Install only if you want a local OpenClaw workspace maintenance tool. Run setup.sh only for a fresh or backed-up workspace because it can replace existing notes/docs/scripts README files, and avoid sharing scheduled audit logs unless you are comfortable exposing workspace paths, recent activity, and repository state.

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
setup.sh:37
Finding
Unconditional File Overwrite and Symlink-Following Write## Vulnerability Details **File Location**: `setup.sh`, lines 37–69 **Vulnerability Type**: Unconditional overwrite and unsafe symbolic-link handling **Risk Level**: Medium ### Vulnerable Code ```bash cat > "$WS/notes/cost-tracking.md" << 'EOF' # Cost Tracking Log ## Multipliers - Creative: 7.5x - Research: 3x - Technical: 2x - Simple: 1.5x | Date | Task | Model | Est. | Actual | Ratio | Notes | |------|------|-------|------|--------|-------|-------| EOF cat > "$WS/notes/README.md" << 'EOF' # Notes Directory Organized notes and tracking files. - `daily-reviews/` — Daily review logs - `decisions/` — Important decisions made - `cost-tracking.md` — Subagent cost tracking EOF cat > "$WS/docs/README.md" << 'EOF' # Documentation Project documentation, guides, and references. EOF cat > "$WS/scripts/README.md" << 'EOF' # Scripts Utility scripts for workspace maintenance and automation. EOF ``` ### Technical Analysis The setup script writes its placeholder files with the shell truncation operator (`>`), without checking whether each destination already exists or is a symbolic link. If a regular destination file exists, it is silently truncated and replaced. This conflicts with the script's initialization purpose because running it again can destroy legitimate workspace content. Shell redirection also follows symbolic links. If an attacker who can modify the selected workspace creates one of the destination paths as a symbolic link, running the setup script causes the link target to be truncated and overwritten. Quoting `"$WS"` prevents shell word splitting but does not prevent symbolic-link traversal or replacement of an existing file. Exploitation requires the attacker to control or modify one of the destination paths before another user runs the script. The target must also be writable by the account executing the setup script. ### Attack Path 1. The attacker obtains write access to the selected workspace or one of its `notes`, `docs`, or `scripts` d ...[truncated 1189 chars]
Remediation
## Remediation Suggestions - Do not overwrite existing files by default. Treat an existing destination as an error or preserve it and report that initialization was skipped. - Reject symbolic-link destinations explicitly with checks such as `[ -L "$destination" ]`. - Verify that destination parent directories are real directories and are owned or trusted by the invoking user. - Create new files with exclusive-creation semantics rather than ordinary `>` redirection. A small helper using `noclobber`, a safely opened file descriptor, or a language API supporting `O_CREAT | O_EXCL | O_NOFOLLOW` is preferable. - If replacement is required, expose an explicit `--force` option and clearly warn that existing content will be destroyed. - For updates, write to a securely created temporary file in the same trusted directory and atomically rename it only after validating the destination. - Avoid recommending or requiring execution with elevated privileges.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description says this skill is a maintenance audit and workspace health-check tool. However, the supplied code is a setup/bootstrap script whose primary function is to create directories and placeholder files in an OpenClaw workspace. It does not inspect the workspace for issues, report health problems, or implement the specific checks named in the description. This is a material purpose mismatch: initialization versus auditing.

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` — Agent instructions
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Vague Triggers

Medium
Confidence
94% confidence
Finding
The README suggests activating the skill with phrases like "Check workspace health" and "What's taking up disk space?" without narrowing the context in which they should map to this skill. These are common requests that could unintentionally collide with other skills or general assistant behavior.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documented audit output includes detailed file paths and recently modified files, and the cron example instructs logging results to a notes file without a privacy warning or minimization guidance. This can expose sensitive project names, memory locations, and user activity patterns to anyone with access to logs or synced notes.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are very broad and map to common user intents such as 'check workspace health' or 'audit my workspace,' increasing the chance the skill is invoked unintentionally. In an agentic environment, accidental invocation can cause unnecessary filesystem scanning and disclosure of sensitive workspace structure or metadata.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest describes this skill as performing workspace health checks and entropy prevention by detecting issues like broken symlinks, empty directories, large files, and malformed names, with a maintenance audit script. This file instead initializes a new workspace layout and writes multiple placeholder files, which is a provisioning/bootstrap capability rather than an audit or detection function.

Description-Behavior Mismatch

Low
Confidence
84% confidence
Finding
The manifest describes entropy-prevention checks like broken symlinks, empty directories, large files, and malformed names. In addition to those, the script also reports disk-usage summaries, total file and directory counts, recently modified files, and Git working-tree status, which broadens the behavior from maintenance checks into repository/activity auditing.

Context-Inappropriate Capability

Low
Confidence
73% confidence
Finding
Checking Git status exposes development workflow and repository state rather than directly detecting structural workspace issues like broken links or malformed names. That capability is adjacent to, but not an obvious requirement of, the manifest's stated maintenance-audit purpose.

Static analysis

No suspicious patterns detected.