Back to skill

Security audit

Book Walker

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a disclosed PDF reader, but it persistently stores arbitrary user templates and tells the host agent to run them as LLM instructions over PDF text.

Review this skill before installing if you will open sensitive PDFs. It caches extracted content locally and allows persistent free-form templates that the host agent is asked to treat as LLM instructions; only use templates you trust, avoid shared environments, and prefer a version with pinned dependencies, cache cleanup, and fixed safe transformation modes.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (3)

T01 · Skill Instruction Hijacking

Error
Location
pdf_reader/template/manager.py:68
Finding

Persistent Untrusted Instructions Are Forwarded to the Hosting Agent

Content
View full analysis
str: """Define or overwrite a template.""" self._load() if "templates" not in self._data: self._data["templates"] = {} self._data["templates"][name] = prompt self._save() return f"✅ Template defined: {name}" def use(self, name: str) -> str: """Select the current template.""" self._load() if name not in self._data.get("templates", {}): return f"❌ Template does not exist: {name}" self._data["current"] = name self._save() return f"✅ Template selected: {name}" ``` The stored prompt is subsequently inserted into the result: ```python template = self.template_mgr.get_current_prompt() if not template or template == "请直接输出原文。": return result text = self._block_text(result) if not text: return result result = dict(result) result["template_payload"] = { "template_prompt": template, "original": text, "page": result.get("page", 1), "block_id": result.get("block_idx", 0), } ``` The formatter then explicitly directs the hosting Agent to process that prompt: ```python payload = data.get("template_payload") if payload: output.append("") output.append(f"--- [{PAYLOAD_MARKER}] ---") output.append("Agent: 请用下方 template_prompt 对 original 调用 LLM 加工(如 原文/翻译/解读),将 LLM 输出呈现给用户。") output.append(json.dumps(payload, ensure_ascii=False)) output.append(f"--- [/{PAYLOAD_MARKER}] ---") ``` ### Technical Analysis The `模板 定义` command accepts arbitrary prompt content without validation, stores it persistently in `templates.json`, and allows the stored prompt to be selected for future PDF operations. ...[truncated 2489 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:11
Finding

Runtime Installation Uses Unpinned Third-Party Dependencies

Content
View full analysis
Remediation
View remediation
--hash=sha256: pypdfium2== --hash=sha256: ``` 5. Review dependency updates before changing the lock file. 6. Use a trusted, authenticated package index or an internally mirrored repository where appropriate. 7. Run installation and document processing with least privilege and without unnecessary credentials in the environment. 8. Add automated dependency vulnerability and provenance checks to the release process. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
pdf_reader/reader/parser.py:380
Finding

Rendered PDF Temporary File Is Not Reliably Deleted After OCR Failure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The document claims a PDF reading/navigation skill, but the specification also introduces template definition, payload emission, and downstream agent-directed LLM prompt processing that are not clearly bounded as secondary features. This mismatch matters because hidden or under-described prompt/payload features can enable indirect prompt injection, unsafe data handling, or user confusion about what content is being sent for model processing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The document claims a PDF reading/navigation skill, but the specification also introduces template definition, payload emission, and downstream agent-directed LLM prompt processing that are not clearly bounded as secondary features. This mismatch matters because hidden or under-described prompt/payload features can enable indirect prompt injection, unsafe data handling, or user confusion about what content is being sent for model processing.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · cli.py (reported line 13)May include surrounding context.

python
if os.path.exists(venv_python) and venv_python != sys.executable:
    # 用 venv 的 python 重新执行
    os.execv(venv_python, [venv_python, __file__] + sys.argv[1:])

# 添加 skill 目录到路径
pdf_reader_dir = os.path.join(skill_dir, 'pdf_reader')

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill description, examples, and command interface are entirely specified in Chinese, with no indication that users may choose another language. This can violate language/locale policy when a skill constrains interaction to a specific language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase 继续 is highly generic in normal conversation and can easily be invoked unintentionally during unrelated dialogue. In a conversational skill, overly broad triggers increase the chance of accidental activation, causing the agent to perform file-reading actions or change state without clear user intent.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

brew install tesseract

Ubuntu

sudo apt install tesseract-ocr

text

## 作者

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

brew install tesseract

Ubuntu

sudo apt install tesseract-ocr

text

## 作者

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares shell-based installation, persistent cache/state storage, and implied file access, but does not define any explicit tool scope or permission boundaries. This increases the blast radius if the skill is invoked unexpectedly or expanded later, because it can read/write local files and execute setup commands without a clear least-privilege contract.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Several trigger phrases such as '开始读', '继续', or '帮助' are common conversational expressions and can overlap with ordinary dialogue. In an agent environment, this raises the risk of accidental invocation of file-oriented behavior, including local PDF enumeration or persistent state updates.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
73% confidence
Finding

The skill installs dependencies into a persistent virtual environment and documents persistent caches, indexes, state, and bookmarks under user directories. Persistent session artifacts can expose document metadata, reading progress, bookmarks, and extracted text across sessions or users if filesystem permissions are weak or the agent environment is shared.

Content

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

md
{
              "id": "venv",
              "kind": "shell",
              "label": "Create venv and install dependencies",
              "command": "cd ~/.openclaw/workspace-e/skills/book-walker && python3 -m venv .venv && .venv/bin/pip install pdfplumber pypdfium2"
            },
          ],

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger condition is broad enough that the skill may activate on general reading-related requests without clear user intent to use this specific capability. Over-broad activation increases the chance of unintentional file scanning, state changes, or exposure of local document metadata when a simpler conversational response was expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The command set includes generic invocations and operations like listing PDFs, opening files, jumping, searching, and defining templates without contextual safeguards. Because these commands operate on local content and persistent state, accidental or adversarial triggering could reveal file names, document excerpts, or modify stored templates/bookmarks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file contains user-facing natural-language strings such as the module docstring and usage/help output only in Chinese. This forces a specific language for end users without any opt-in, fallback, or justification, which matches the language/locale policy violation criteria.

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 description and the user-facing command surface are written entirely in Chinese, and command parsing throughout the file expects Chinese phrases such as '开始读', '去第...页', and '模板'. This imposes a specific language/locale on users without any explicit opt-in or documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The reader attaches a user-selectable template prompt and raw PDF block text into a downstream 'template_payload' for later LLM processing. This expands the skill from passive document reading into arbitrary prompt injection and content-transformation orchestration, which can be abused to manipulate downstream agent behavior, exfiltrate sensitive document content, or bypass the skill's declared scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command interface exposes template listing, selection, and definition despite the skill being presented as a PDF navigation tool. Allowing runtime definition of arbitrary prompt templates creates an instruction injection surface that lets users repurpose the skill to drive downstream LLM actions unrelated to document reading, increasing the chance of prompt abuse, unsafe data handling, and hidden capability escalation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file uses Chinese-only user-facing exception messages, return messages, and docstrings throughout, such as "未加载PDF", "已到达文档末尾", and other navigation text. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code file uses Chinese-only natural-language descriptions such as the module docstring and subsequent class/method docstrings, with no indication that the skill is region-specific or that users can opt into the locale. Under the policy, forcing a specific language without user choice can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes an interactive PDF reader for reading, navigation, search, bookmarks, and PDF list organization. In contrast, OCR extraction shells out to the local tesseract binary using subprocess.run, adding process-execution capability that is materially broader than ordinary PDF parsing and not declared in the stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

OCR mode renders a PDF page to a temporary PNG on disk before recognition, which can expose sensitive document contents to other local users, backups, or forensic recovery if file permissions or cleanup fail. The file is created with delete=False and only unlinked on the success path, so exceptions before cleanup may leave sensitive page images behind.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The OCR subprocess invocation forces Tesseract to use the English language model via the 'eng' parameter. This is a locale/language policy concern because the skill does not offer user opt-in or configuration for other languages despite processing arbitrary PDFs.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · pdf_reader/reader/parser.py (reported line 388)May include surrounding context.

python
pdf_doc.close()
            
            # 2. OCR 识别 (使用 tesseract)
            result = subprocess.run(
                ["tesseract", img_path, "-", "-l", "eng"],
                capture_output=True,
                text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The parser extracts embedded page images and saves cropped PNGs into a cache directory, creating persistent copies of potentially sensitive document content beyond the original PDF. In a document-reading skill, silent retention of extracted images increases privacy and data-handling risk, especially if cache lifetime, permissions, or location are not tightly controlled.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes an interactive PDF reader for reading, paging, searching, bookmarks, and PDF list organization. While OCR support is mentioned in the module docstring, spawning the external tesseract binary through subprocess.run introduces process-execution capability that is not explicitly justified by the manifest's stated scope and is more powerful than ordinary text extraction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function extract_with_ocr sets lang: str = "eng" and the docstring states the default is English, which imposes a specific language/locale behavior in natural-language-visible code. The file does not show any user opt-in, language selection prompt, or justification for restricting OCR to English by default.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.