Back to skill

Security audit

First-Principles-Deconstructor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a product-analysis helper, but it automatically reads from and writes to a fixed shared OpenClaw directory, which creates cross-session data and overwrite risks.

Review this skill before installing if you use shared or long-lived OpenClaw environments. Its analysis behavior is understandable, but it should ideally ask before using ~/.openclaw/swarm_tmp, isolate files per run, avoid overwriting existing reports, and treat any expert_output.json as untrusted input.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILLS.md:26
Finding

Cross-Project File Access Violates Least-Privilege Boundaries

Content
View full analysis

Vulnerability Details

File Location: SKILLS.md, lines 26-28
Vulnerability Type: Unauthorized cross-project file read and write
Risk Level: Medium

Vulnerable Code

markdown
#### Phase 4: Chaining & Cross-Verification (Critical)
* **Action:** Consume data from `~/.openclaw/swarm_tmp/expert_output.json` if available.
* **Serialization:** Map findings into the local `audit_schema.json`.
* **Persistence:** Write the final report to `~/.openclaw/swarm_tmp/audit_report.json`.

Technical Analysis

The Skill directs the Agent to read from and write to shared paths outside the project directory. These operations are not necessary for the core first-principles analysis described by the Skill and therefore exceed the minimum file permissions required for its stated purpose.

The instructions provide no safeguards for:

  • Verifying the ownership or provenance of expert_output.json
  • Validating imported content against a strict schema
  • Limiting input size
  • Preventing symbolic-link traversal
  • Preventing overwrite of an existing report
  • Ensuring that writes are atomic
  • Obtaining explicit user authorization for shared-state access

Consequently, an attacker with write access to the shared temporary directory could supply manipulated expert output or redirect either path through a symbolic link. Although no executable code is present, untrusted content could influence the Agent's conclusions, while an unsafe output target could overwrite data accessible to the Agent.

Attack Path

  1. An attacker gains write access to ~/.openclaw/swarm_tmp or causes a malicious file or symbolic link to exist there.
  2. The attacker creates a crafted expert_output.json containing misleading or adversarial content, or redirects the input path to another readable file.
  3. When the Skill runs, its instructions cause the Agent to consume that external content without provenance or integrity checks.
  4. The manipulated content affects the generated audit ...[truncated 840 chars]
Remediation
View remediation

Remediation Suggestions

  1. Default all input and output paths to a dedicated project-local directory.
  2. Require explicit user authorization before reading or writing any path outside the project root.
  3. Treat imported expert output as untrusted data and validate it against a strict schema before use.
  4. Enforce canonical-path containment checks and reject symbolic links for both input and output files.
  5. Apply file-size and nesting limits before parsing JSON.
  6. Create output files with exclusive creation semantics and restrictive permissions.
  7. Write to a verified temporary file and atomically rename it to the final destination.
  8. Refuse to overwrite existing files unless the user explicitly approves the operation.
  9. Record the source and integrity metadata of imported reports so downstream workflows can distinguish trusted from untrusted content.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file includes a 'Usage' section with examples like 'research:' and 'compare:' but does not state whether these are the only valid trigger phrases, nor does it provide scope limits or negative examples. That ambiguity can cause unintended invocation because users and systems cannot clearly distinguish the intended activation conditions from ordinary analysis requests.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

This skill establishes cross-session persistence by reading from and writing to fixed files in ~/.openclaw/swarm_tmp, which can carry data between otherwise separate tasks or users of the environment. In skill context, the danger is higher because the file is positioned as an automatic input/output channel for chained analysis, enabling unintended data retention, stale data poisoning, or exfiltration through later runs.

Content

Scanner excerpt · SKILLS.md (reported line 28)May include surrounding context.

md
#### Phase 4: Chaining & Cross-Verification (Critical)
* **Action:** Consume data from `~/.openclaw/swarm_tmp/expert_output.json` if available.
* **Serialization:** Map findings into the local `audit_schema.json`.
* **Persistence:** Write the final report to `~/.openclaw/swarm_tmp/audit_report.json`.

### 3. Hard Constraints
* **C1 (Zero-Tolerance):** Use of marketing terms (e.g., "Revolutionary," "Leading-edge") **SHALL** trigger a mandatory rewrite.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly instructs writing a report into a user-local path under ~/.openclaw/swarm_tmp without any notice, consent, or safety boundary. Even though the target appears to be an application temp area, this still creates an unauthorized local file modification side effect and can overwrite prior artifacts, leak derived data across runs, or be abused in chained workflows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
62% confidence
Finding

The file mixes Chinese and English throughout but does not explicitly say whether the skill will respond in one language by default or according to user preference. If organizational policy requires user opt-in for language or locale selection, this undocumented behavior could lead to an unintended language choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.