Back to skill

Security audit

Knowledge Lib

Security checks for vulnerabilities and agentic risk

Overview

This is a plausible personal wiki helper, but it needs review because it can write outside its stated knowledge folder and declares offline behavior while normal link ingestion expects web fetching.

Review before installing. Use it only where writes to the OpenClaw knowledge directory are acceptable, avoid sensitive material unless you are comfortable with persistent logs and analyses, and treat URL ingestion as a network operation. Do not pass untrusted category, slug, or raw-file paths until containment validation is added.

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

T09 · Insecure Skill Coding Practices

Warning
Location
ingest.sh:8
Finding

Path Traversal Through an Unvalidated Category Argument

Content
View full analysis
[category] [slug]" exit 1 fi # Auto-generate slug from URL if not provided if [ -z "$SLUG" ]; then SLUG=$(echo "$URL" | sed 's|https\?://||; s|/.*||; s|[^a-zA-Z0-9-]|-|g' | head -c 60) fi RAW_DIR="$KB_DIR/raw/$CATEGORY" mkdir -p "$RAW_DIR" RAW_FILE="$RAW_DIR/${DATE}-${SLUG}.md" ``` ### Technical Analysis The `CATEGORY` command-line argument is incorporated directly into `RAW_DIR` without validation, normalization, or a canonical containment check. Although the documented categories are limited to `ai-llm`, `engineering`, `products`, and `startups`, the script does not enforce this allowlist. A value containing parent-directory components, such as `../../../../tmp/attacker`, causes the path to resolve outside `$KB_DIR/raw`. The subsequent `mkdir -p` creates the escaped directory, and the heredoc at `ingest.sh:36-49` creates a date-prefixed Markdown file in that location. Shell quoting prevents command substitution and shell metacharacter injection, but it does not prevent filesystem path traversal. ### Attack Path 1. An attacker, untrusted automation, or manipulated Agent controls the category supplied to `ingest.sh`. 2. The caller invokes the script with a traversal value, for example: ```bash ./ingest.sh "https://example.invalid/source" "../../../../tmp/attacker" "payload" ``` 3. `RAW_DIR` resolves outside the intended knowledge-base directory. 4. `mkdir -p "$RAW_DIR"` creates the external directory if permissions allow. 5. The script creates a file such as `/tmp/attacker/YYYY-MM-DD-payload.md`. 6. Attacker-controlled URL and category text are written i ...[truncated 675 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` 2. Validate the slug independently, even when supplied by the caller: ```bash if [[ ! "$SLUG" =~ ^[A-Za-z0-9][A-Za-z0-9-]{0,59}$ ]]; then echo "ERROR: Invalid slug" >&2 exit 1 fi ``` 3. Canonicalize the base and destination paths and verify that the destination remains beneath the canonical `$KB_DIR/raw` directory before creating anything. 4. Reject path separators, `..`, control characters, empty values, and unexpected Unicode separator characters. 5. Create files with restrictive permissions and fail rather than following unexpected symbolic links. Where supported, use a trusted helper that performs no-follow and exclusive-create operations. 6. Add regression tests covering traversal values, absolute-looking values, symbolic-link destinations, invalid categories, and malformed slugs. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:10
Finding

Declared Offline Behavior Conflicts With the Link-Ingestion Workflow

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description suggests a broader wiki-management skill for organizing notes into structured markdown pages, creating summaries and cross-references, and handling knowledge-base queries. The provided code chunk instead performs a narrow ingestion task: it accepts a URL, category, and optional slug, creates a raw markdown stub in a knowledge-base directory, and appends a log entry. While this is related to a knowledge base, the actual behavior is materially narrower and different from the declared functionality. It also introduces an undeclared capability of URL-based ingestion/workflow setup. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is related to a knowledge base, but its primary purpose is maintenance auditing, not wiki management in the sense described. It does not add notes, generate concept pages/summaries, or answer knowledge-base queries. Instead, it inspects the filesystem for markdown content issues and appends results to a log. That write operation and the lint/audit role are undeclared capabilities, making this a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation condition 'asks to query knowledge base, or mentions knowledge base' is broad enough to trigger on casual or ambiguous conversation. Because the skill has file write capability and may persist query outputs or logs, over-broad triggering can cause unintended reads/writes in the user's workspace without sufficiently explicit intent.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
83% confidence
Finding

This skill intentionally persists user-provided and generated content to disk, including raw source material and operational logs. In the context of a personal knowledge base, persistence is expected, but it still creates privacy and retention risk if sensitive prompts, documents, or query results are stored without minimization, transparency, or user control.

Content

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

md
metadata:
  permissions:
    - file:read
    - file:write
  behavior:
    network: none
    telemetry: none

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill performs persistent filesystem writes to raw documents, summaries, analyses, indexes, and logs, but the user-facing description does not clearly warn that invoking save or some query flows will modify files under the workspace. This weakens informed consent and can lead to unintended persistence of sensitive or copyrighted content.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The quick command 'deep check' is generic and context-free, making accidental activation more likely. In this skill, that could initiate broad scanning/linting across the knowledge workspace and possibly generate writes or reports the user did not intend.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.