Back to skill

Security audit

Wiki Creator

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local wiki skill, but it should be reviewed because its helper scripts can operate outside their intended wiki boundaries and it automatically reuses persistent local knowledge.

Review before installing. Use an explicit --root in a non-sensitive location, avoid storing confidential documents unless you are comfortable with local persistence, and patch the scripts to validate topic slugs, enforce path containment, restrict parse_raw.py to raw/, and add deletion/retention controls before routine use.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/build_index.py:205
Finding

Arbitrary Markdown File Overwrite Through Unsanitized Topic Slug

Content
View full analysis
None: """Generate wiki/topics/.md.""" topics_dir = wiki_dir / "topics" topics_dir.mkdir(exist_ok=True) by_topic = defaultdict(list) for p in pages: by_topic[p["topic"]].append(p) # Remove old indexes for old in topics_dir.glob("*.md"): old.unlink() for slug, group in by_topic.items(): t = topics.get(slug, {}) name = t.get("name", slug) group.sort(key=lambda p: (ENTITY_ORDER.get(p["entity_type"], 99), p["title"])) by_type = defaultdict(list) for p in group: by_type[p["entity_type"] or "Other"].append(p) lines = [ f"", f"# {name}", "", f"Total pages: {len(group)}.", "", ] for et in sorted(by_type.keys(), key=lambda x: ENTITY_ORDER.get(x, 99)): lines.append(f"## {et}") for p in by_type[et]: summary = p["summary"] summary_str = f" — {summary}" if summary else "" lines.append(f"- [[{p['slug']}]] {p['title']}{summary_str}") lines.append("") (topics_dir / f"{slug}.md").write_text("\n".join(lines), encoding="utf-8") ``` ### Technical Analysis The `topic` value is read from page frontmatter and propagated into `p["topic"]`. It is then used as the `slug` component of an output path without validating that it is a single, safe kebab-case identifier. The expression: ```python topics_dir / f"{slug}.md" ``` does not guarantee that the resulting path remains under `wiki/topics`. A topic containing parent-directory components, such ...[truncated 2013 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/parse_raw.py:190
Finding

Raw Document Parser Allows Unrestricted Local File Reads and Arbitrary Output Paths

Content
View full analysis
int: parser = argparse.ArgumentParser(description="Parse raw file into clean Markdown") parser.add_argument("file", help="raw file path") parser.add_argument( "-o", "--output", help="write output to a UTF-8 file; otherwise use stdout" ) args = parser.parse_args() path = Path(args.file).expanduser().resolve() if not path.exists(): print(f"Error: file does not exist: {path}", file=sys.stderr) return 1 content = parse(path) if args.output: Path(args.output).write_text(content, encoding="utf-8") print(f"Wrote {args.output} ({len(content)} characters)", file=sys.stderr) else: print(content) return 0 ``` ### Technical Analysis The Skill describes `parse_raw.py` as a parser for files in the wiki’s `raw/` directory. Its module documentation also advertises a `--raw-root` argument, but the implemented argument parser does not provide or enforce such a boundary. The input path is expanded and resolved, but it is only checked for existence. There is no verification that it is: - Located under the expected `raw/` directory. - A regular file rather than another filesystem object. - Within the selected wiki root. - Not reached through a symlink that escapes the intended directory. As a result, any readable local file can be supplied as the positional argument. Text-compatible files are returned through standard output, while supported document formats are processed by their corresponding parser. The optional output path is also accepted without restriction. Parsed content can therefore be written to any location writable by the process. This output behavior is not equivalent to arbitrary attacker-controlled file content, because the parser adds a generated ...[truncated 1674 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a full wiki system with global, project-independent behavior and multiple user-facing capabilities. The code chunk, however, is a small utility for filesystem root detection. Its most notable behavior directly conflicts with the description: when a project marker is found, it binds the wiki root to the project directory instead of using a purely global wiki. While this could be a supporting helper in a larger system, the explicit project-scoped behavior is materially inconsistent with the declared 'global, project-independent' purpose. The rest of the advertised capabilities are not represented in this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a full wiki-building and maintenance skill: creating/updating a knowledge wiki from uploaded documents, using a specific no-vector design, and serving search/lookup and health-check use cases. The supplied code chunk is much narrower. It assumes a wiki already exists, reads existing markdown pages under wiki/pages, and generates derived index/metadata files (index.md, topics/*.md, .backlinks.json, .graph.json, .manifest.json). It explicitly says it does not do semantic creation, and there is no code for document ingestion, LLM-based page generation, search, query answering, or lint/health diagnostics. While its behavior supports maintaining a wiki index, it does not match the broader declared primary purpose and user-facing capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad wiki system that builds and maintains a knowledge wiki from uploaded documents and supports update, search, and health-check workflows. The supplied code chunk is much narrower: it is an initialization script that creates directory structure and placeholder files for a wiki workspace. While this is related to wiki setup, it does not implement the main declared behaviors such as reading uploaded documents, compiling knowledge, maintaining a global knowledge base, searching wiki contents, or prioritizing wiki answers over web search. Therefore the code’s actual behavior is only a small supporting subset of the declared purpose, making the description materially overstated for this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a broad end-to-end wiki skill: create/build wiki, update it with new materials, search/use it for answering questions, and perform health checks. The provided code only covers the last narrow piece: linting an already-existing wiki directory. It has no document ingestion, no wiki generation, no retrieval or QA behavior, and no web-search coordination logic. While 'wiki health check / lint' is indeed mentioned in the declared purpose, this code chunk alone materially under-implements the described primary functionality and instead has a much narrower actual purpose. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code chunk is limited to document ingestion/parsing: it reads one file, chooses a parser by extension, extracts text/table content, annotates sections with § markers, and outputs markdown. That may be a supporting preprocessing component for a wiki pipeline, but it does not itself implement the declared primary behavior of creating or maintaining a global wiki, building a topic/page index, answering searches from the wiki, updating an existing wiki, or performing lint/health checks. There are no retrieval, indexing, storage, corpus-management, or trigger-handling capabilities present. Therefore the description materially overstates and misrepresents what this code actually does.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

Activating the skill for any knowledge question whenever a wiki exists is overly broad and can silently route unrelated prompts through local file reads. That increases the chance of unnecessary exposure of persisted data, surprising behavior, and unauthorized use of local knowledge stores outside the user's intended context.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
6. 执行 `python scripts/build_index.py` → 生成 `index.md` + `topics/*.md` + 反链 + graph + manifest。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
6. 执行 `python scripts/build_index.py` → 生成 `index.md` + `topics/*.md` + 反链 + graph + manifest。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
6. 执行 `python scripts/build_index.py` → 生成 `index.md` + `topics/*.md` + 反链 + graph + manifest。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill describes filesystem read/write behavior but does not declare any explicit tool scope, permissions, or allowed-tools boundary. In practice this creates an authorization ambiguity: an agent may grant broader file access than users expect, especially because the skill persists uploaded documents and generates files under local directories.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The skill is explicitly designed around a persistent wiki that survives across interactions by storing user-provided material locally. Session persistence is security-relevant here because it accumulates potentially sensitive documents and derived knowledge across time, increasing the blast radius of later reads, cross-task leakage, and unintended reuse.

Content

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

md
---
name: "wiki-creator"
description: "Builds and maintains a global, project-independent knowledge wiki from user-uploaded documents using Karpathy's native LLM Wiki paradigm (zero vectors, zero chunks, single-page units, two-level topic/page index). Invoke when user uploads documents and asks to 'create wiki / build wiki / compile knowledge base', says 'update wiki / add new materials', asks 'search wiki / look up X / use wiki / 用wiki查', or asks for 'wiki health check / lint'. When a knowledge question is asked and a wiki exists, ALWAYS check the wiki FIRST before web search. Does NOT use vector retrieval."
---

# Wiki Creator

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation contradicts itself about whether data is stored globally or per-project, which can cause the agent to write sensitive documents to an unexpected location. That ambiguity materially affects confidentiality and data governance because users may believe content is isolated to a project when it may instead persist in a shared home-directory wiki, or vice versa.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill content is written as if the operating language is fixed to Chinese, and there is no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation unless the constraint is clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs copying uploaded files into a persistent raw/ directory without requiring a clear disclosure or consent about retention. This creates a privacy and compliance risk because sensitive user documents may be stored on disk longer than expected and potentially in locations shared across sessions or projects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown template includes Chinese-only labels such as "概念", "摘要", "定义", and related section headings, which imposes a specific language/locale in the skill content. The file does not offer alternatives or document that this is a justified region-specific template, so it constitutes a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The writing-style rule states '语言:中文为主', which imposes a language preference in the template itself. Under the policy, forcing a specific language without offering user choice or explaining a justified regional constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documentation is entirely written as an instruction set in Chinese and explicitly states it must be read during LLM processing, which implies a language-specific operating mode. There is no indication that users may choose another language or that the Chinese-only requirement is justified by a region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document requires all slugs to be written in English ("kebab-case 英文") and forbids Chinese titles in link targets. This is a language policy constraint expressed in natural language, and the file does not present it as an optional user choice or justified region-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The wikilink rules require only English kebab-case slugs and explicitly disallow Chinese and other naming styles. This imposes a language/locale restriction across content authoring without offering alternatives or stating a justified compliance or platform limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language documentation is entirely in Chinese and describes shared behavior for scripts, which can amount to a language/locale constraint if the skill is expected to serve general users without explicit opt-in. Under the policy, forcing a specific language without offering a choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script unconditionally removes all existing files under wiki/topics/*.md before regenerating indexes. Although this may be part of index rebuilding, there is no confirmation prompt or user-facing warning in code indicating that existing files in that directory will be deleted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring, CLI description, and inline comments are written in Chinese, which imposes a specific language on users and maintainers. The file does not indicate that Chinese is optional, user-selectable, or required for a region-specific purpose, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The template states 语言:中文为主, which imposes a language preference in natural-language instructions embedded in the code. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless it is clearly justified as region-specific or optional.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code creates directories and writes multiple files under the target root, and --force allows existing contents such as SCHEMA.md, index.md, and metadata JSON files to be overwritten. While the CLI help mentions force rebuild, the code path itself provides no confirmation prompt or runtime warning before modifying files, which is a safety-relevant operation for code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language docstrings and CLI descriptions entirely in Chinese, including the tool description and output-field explanations. Because no user opt-in or locale-selection mechanism is provided, the skill appears to impose a specific language, which matches the policy-violation criterion for language or locale restrictions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.