Back to skill

Security audit

Workspace Guardian

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly an OpenClaw workspace maintenance helper, but it asks agents to run automatic repairs that can change config, restart services, and loosen file permissions without clear user control.

Review before installing. This skill should only be used in an OpenClaw workspace where automatic file creation, config validation, possible config edits, gateway restarts, and permission repairs are acceptable. Prefer requiring explicit approval before changing openclaw.json, restarting services, or modifying permissions, and replace chmod 644 with a least-privilege mode scoped to known safe files.

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/guardian-startup.sh:121
Finding

Workspace Memory Files May Be Exposed to Other Local Users

Content
View full analysis

Vulnerability Details

File Location: scripts/guardian-startup.sh, lines 121-126
Vulnerability Type: Insecure file permissions and unsafe filename iteration
Risk Level: Medium

Vulnerable Code

bash
if [ -d "$WORKSPACE" ]; then
  # Garantir que arquivos do workspace são legíveis
  for f in $(find "$WORKSPACE" -name "*.md" -not -readable 2>/dev/null); do
    chmod 644 "$f"
    echo "✅ Corrigido permissão: $f"
    FIXED=$((FIXED + 1))
  done
fi

Technical Analysis

The startup script recursively searches the workspace for Markdown files that are not readable by the account running the script and changes their mode to 0644. This grants read access to the owner, group members, and every other local user.

Workspace Markdown files include MEMORY.md, daily journals, and potentially other agent-generated records. Such files may contain private conversations, operational notes, customer data, credentials, or other sensitive information. Making them world-readable violates least privilege and may expose their contents to unrelated local accounts or compromised low-privilege processes.

The loop also uses unquoted command substitution:

bash
for f in $(find ...); do

Shell word splitting and pathname expansion are therefore applied to find output. Paths containing whitespace, newline characters, or glob metacharacters may be split or expanded into unintended arguments. Although "$f" is quoted later, corruption has already occurred while assigning loop values.

Attack Path

  1. A Markdown file containing sensitive workspace or agent memory data exists under /data/.openclaw/workspace.
  2. The file is not readable by the account executing the guardian script, such as because it has restrictive permissions or mismatched ownership.
  3. The guardian runs automatically at startup or is invoked during a health check.
  4. The recursive find operation selects the sensitive file.
  5. The script executes chmod 644, granting every lo ...[truncated 952 chars]
Remediation
View remediation

Remediation Suggestions

Preserve least privilege by granting access only to the service owner. For sensitive workspace records, use mode 0600 rather than 0644. Process filenames with a null-delimited loop to avoid word splitting and glob expansion:

bash
find "$WORKSPACE" -type f -name '*.md' -not -readable -print0 |
  while IFS= read -r -d '' f; do
    chmod 600 -- "$f"
    echo "Corrected permissions: $f"
  done

Additional hardening should include:

  1. Verify that each file is owned by the expected service account before changing its permissions.
  2. Correct unexpected ownership explicitly and safely rather than compensating by granting global read access.
  3. Restrict permission repair to an allowlist of files managed by this skill, such as MEMORY.md and daily journal files.
  4. Ensure workspace directories use restrictive modes, such as 0700, where operationally compatible.
  5. Avoid following symbolic links and confirm that each selected item is a regular file within the canonical workspace path.
  6. Add tests covering filenames containing spaces, newlines, wildcard characters, and leading hyphens.
  7. Review previously processed workspace files and remove unintended group or world access, for example by applying an appropriately scoped chmod go-rwx.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill promises broad auto-healing, retry/fallback behavior, periodic checks, and automatic correction, but the documented behavior is much narrower and partly detection-only. This mismatch is dangerous because operators may trust the skill to safely remediate runtime issues or config faults when it may instead perform incomplete fixes or leave the system in an unsafe state.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs automatic configuration repair and gateway restart when config issues are found, again without explicit warning or approval. In context, modifying openclaw.json and restarting infrastructure can disrupt service, mask root causes, or be abused through crafted error conditions to force harmful config changes or denial of service.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs execution of a shell script (bash scripts/guardian-startup.sh) but declares no permissions or allowed-tools scope. That mismatch hides the skill's true execution capabilities from reviewers and policy controls, increasing the risk of unintended or overly broad command execution in a startup path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description and instructions are presented in Portuguese, which imposes a specific language on users without any opt-in or explanation of a regional requirement. This can violate language or locale policy when the skill does not offer alternatives or justify the constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is configured to run automatically on startup, periodically, and when the agent detects recurring errors, but those triggers are defined broadly and ambiguously. In a privileged workspace-management context, vague auto-invocation can cause repeated execution, unreviewed state changes, and invocation during attacker-induced error conditions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs automatic creation of files/directories and correction of workspace state during startup without a user-facing warning or approval step. Silent mutation of the workspace can overwrite expectations, interfere with other tooling, and make malicious or accidental changes harder to detect, especially because it runs automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all operational guidance in Portuguese, which can amount to a language/locale policy violation when the skill does not explicitly offer user opt-in or document that it is intended only for Portuguese-speaking users. The file contains no notice that the locale is intentional or limited to a specific region or audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document content is written entirely in Portuguese and includes terms like "obrigatório" and operational instructions only in that language, which can amount to forcing a specific language without user opt-in. The policy allows locale constraints only when the user is given a choice or the restriction is clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script’s comments and all user-visible status/error messages are written in Portuguese, indicating a fixed locale for operator interaction. This can violate language/locale policy when no user opt-in or documented regional justification is provided.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/guardian-startup.sh (reported line 122)May include surrounding context.

sh
if [ -d "$WORKSPACE" ]; then
  # Garantir que arquivos do workspace são legíveis
  for f in $(find "$WORKSPACE" -name "*.md" -not -readable 2>/dev/null); do
    chmod 644 "$f"
    echo "✅ Corrigido permissão: $f"
    FIXED=$((FIXED + 1))
  done

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file instructs running bash scripts/guardian-startup.sh, curl health checks, log inspection, and disk checks, but it does not warn that the skill will execute shell commands and make local network requests. Under the markdown-specific missing-warning rule, operational behaviors that could affect system integrity or privacy should be disclosed to the user.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.