Back to skill

Security audit

wiki-maintainer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent as a local wiki maintainer, but it can run an unreviewed local shell script automatically and relies on mutable external wiki instructions.

Install only if you control the target llm-wiki directory and have reviewed its AGENTS.md and tools/lint.sh. Treat queries as potentially write-capable, and require confirmation before running lint, repairs, or saving generated answers back into the wiki.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:105
Finding

Execution of an Unverified External Lint Script

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 105-110
Vulnerability Type: Unverified execution of a mutable external tool
Risk Level: High

Evidence

markdown
When the user requests a wiki health check, or automatically after every 10 ingest operations:

### Step 1 — Run the tool

```bash
bash /Users/clax/Documents/doc_synced/llm-wiki/tools/lint.sh
text

The displayed prose is an English translation of the surrounding instructions; the shell command is reproduced verbatim.

### Technical Analysis

The skill instructs the agent to execute a shell script at a fixed absolute path outside the audited project. The referenced `lint.sh` is not included in the package, so its contents, provenance, permissions, and integrity cannot be assessed.

Invoking the file explicitly through `bash` treats all of its contents as executable shell code. If another process or user can replace or modify the script, a legitimate-looking lint action becomes an arbitrary command-execution channel. The automatic trigger after every ten ingest operations further increases exposure because execution does not necessarily require a separate, explicit request at the time the command runs.

This is classified as tool hijacking because the trusted lint operation can be replaced with attacker-controlled behavior without changing the reviewed skill file.

### Attack Path

1. An attacker obtains write access to `/Users/clax/Documents/doc_synced/llm-wiki/tools/lint.sh` or replaces a writable component in its path.
2. The attacker inserts arbitrary shell commands into the script.
3. A user requests a lint operation, or the automatic ten-ingest threshold is reached.
4. The agent executes the external file using `bash`.
5. The injected commands run with the operating-system identity and environment of the agent process.

### Impact Assessment

Successful exploitation permits arbitrary command execution with the agent proce
...[truncated 386 chars]
Remediation
View remediation

Remediation Suggestions

  1. Include the lint implementation inside the reviewed skill package rather than referencing a mutable absolute path.
  2. Verify the script against a pinned cryptographic digest immediately before execution.
  3. Refuse to run the script when its owner, permissions, resolved path, or digest differs from the approved configuration.
  4. Require explicit user confirmation before each execution; remove the automatic ten-ingest execution trigger.
  5. Run linting in a sandbox with read-only access wherever possible, no unnecessary credentials, restricted network access, and write access limited to explicitly approved wiki files.
  6. Prefer a structured lint API or an audited executable with fixed arguments instead of invoking an unrestricted shell interpreter.
  7. Resolve and validate the canonical path to prevent symbolic-link or path-component replacement attacks.

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:11
Finding

Operational Instructions Loaded from an Untrusted External AGENTS.md File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 11-14
Vulnerability Type: External instruction trust-boundary violation
Risk Level: Medium

Evidence

markdown
## Read Engine

Before every operation, read `AGENTS.md` and `index.md` from the target wiki to understand its current state.

The snippet is an English translation of the original instruction. Additional references at lines 29 and 147 direct the agent to use templates and complete specifications from the same external AGENTS.md.

Technical Analysis

The skill requires the agent to read a mutable AGENTS.md located in the external target wiki before every operation and relies on that file for templates and operational specifications. The external file is not present in the audited project and therefore cannot be reviewed or integrity-pinned as part of this skill.

An AGENTS.md file is conventionally interpreted as agent-facing instructions rather than ordinary source data. If an attacker can modify the wiki, the attacker can add directives that attempt to change the agent's workflow, induce additional tool calls, request access to unrelated files, or cause unsafe modifications. Loading the file before every operation repeatedly exposes the session to those directives.

Higher-priority system and user policies should still take precedence, but the skill provides no instruction-isolation rule, schema validation, integrity check, or explicit restriction requiring external content to be treated solely as untrusted data.

Attack Path

  1. An attacker gains the ability to modify the target wiki's AGENTS.md.
  2. The attacker inserts agent-directed instructions, such as requests to read unrelated files, execute commands, disclose information, or alter additional content.
  3. A user invokes any ingest, query, lint, or batch-ingest operation.
  4. Following SKILL.md, the agent reads the compromised AGENTS.md before proceeding.
  5. If ...[truncated 624 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bundle the required templates and operational rules inside the reviewed skill package.
  2. Treat all files in the target wiki, including files named AGENTS.md, as untrusted content rather than executable instructions.
  3. State explicitly that external repository text cannot expand permissions, alter safety constraints, authorize commands, or override system, developer, user, or packaged skill instructions.
  4. If external configuration is necessary, use a strict machine-readable schema containing only approved fields and reject unknown fields or free-form directives.
  5. Pin the approved external configuration by cryptographic digest or authenticated version and require confirmation when it changes.
  6. Apply allowlists for accessible paths, permitted write locations, executable commands, and network destinations.
  7. Parse templates as inert data and prevent their contents from being reinterpreted as agent instructions.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The ingest workflow directs the agent to create and update multiple files under a real local path without clearly warning the user that invoking the skill will persistently modify data on disk. This is dangerous because a user may believe they are requesting analysis only, while the skill actually performs broad repository mutations, increasing the chance of unintended data changes or corruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The query workflow says that answers deemed valuable may be saved back into the wiki, but it does not clearly disclose that a normal question can cause persistent file creation. This blurs the boundary between read-only retrieval and write operations, making it easy to surprise users with unauthorized or unwanted changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The lint workflow includes running a shell script and then automatically fixing issues such as adding references, ingesting missing sources, or regenerating index content, yet it does not warn that a health check can modify repository state. Users may invoke lint expecting diagnostics only, but instead trigger cascading changes to tracked content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The natural-language instructions are presented solely in Chinese and do not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under SQP-3, forcing a specific language without opt-in can be a locale policy issue when no justification is provided.

Content

No source excerpt is available for this finding.