Back to skill

Security audit

large-document-reader

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate document-processing purpose, but its bundled scripts use hard-coded personal file paths and do not match the advertised workflow.

Review this skill before installing. Only use it in a controlled workspace, replace the hard-coded paths with explicit user-approved input and output paths, and avoid running it on confidential, regulated, or unpublished documents unless local persistence of extracted content is acceptable.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract_chapters.py:126
Finding

Hard-Coded Access to Personal Files Outside the Project Boundary

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/extract_chapters.py:126
  • scripts/extract_chapters.py:145-147
  • scripts/save_chapters.py:10-16

Vulnerability Type: Hard-coded sensitive local paths and unexpected local-file access
Risk Level: Medium

Vulnerable Code

scripts/extract_chapters.py:126:

python
file_path = "/Users/chenkuan/Desktop/毕业论文/规模与杠杆对银行系统性风险的影响研究_王怡涵.txt"

scripts/extract_chapters.py:145-147:

python
with open('/Users/chenkuan/.openclaw/workspace/large-document-reader-1.0.0/chapters_info.json', 'w', encoding='utf-8') as f:
    import json
    json.dump(chapters, f, ensure_ascii=False, indent=2)

scripts/save_chapters.py:10-16:

python
# 读取章节信息
with open('chapters_info.json', 'r', encoding='utf-8') as f:
    chapters = json.load(f)

# 读取原始文件
with open('/Users/chenkuan/Desktop/毕业论文/规模与杠杆对银行系统性风险的影响研究_王怡涵.txt', 'r', encoding='utf-8') as f:
    original_lines = f.readlines()

Technical Analysis

Both scripts embed absolute paths tied to a specific user's home directory and personal document. When executed, the code attempts to read that document without obtaining an input path or explicit file selection from the current user. The extraction script additionally writes generated data to a fixed workspace path outside the current project directory.

The file content is processed with the privileges of the account running the scripts. Therefore, any file accessible to that account at the hard-coded location may be read and transformed into generated artifacts. The embedded username and document title also disclose local environment and personal-document metadata.

This behavior does not match the documented workflow, which presents the input as a document supplied by the user. It also makes the scripts non-portable and can cause data to be read from or written to an unintended location.

Attack Path

  1. An agent or user invokes `s ...[truncated 1365 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove all absolute personal paths and document names from the source code.
  2. Require input and output paths through explicit command-line arguments, such as --input, --chapters-dir, and --metadata-output.
  3. Resolve and validate paths before access. Reject nonexistent inputs, non-regular files, unsupported extensions, and output paths outside a user-approved directory.
  4. Require explicit user authorization before reading any file outside the current project workspace.
  5. Default generated output to a project-relative directory and create it safely with Path.mkdir(parents=True, exist_ok=True).
  6. Avoid overwriting existing files unless the user supplies an explicit overwrite option.
  7. Remove unused reads, including original_lines in save_chapters.py, if the original document is not required.
  8. Avoid placing usernames, personal document titles, or other environment-specific metadata in committed source code.
  9. Add error handling for permission failures, malformed JSON, invalid encodings, and unsafe output destinations.
  10. Document the exact filesystem inputs and outputs so execution behavior matches the stated skill workflow.

A safer interface would follow this pattern:

python
from argparse import ArgumentParser
from pathlib import Path

parser = ArgumentParser()
parser.add_argument("--input", required=True, type=Path)
parser.add_argument("--output-dir", required=True, type=Path)
args = parser.parse_args()

input_path = args.input.expanduser().resolve()
output_dir = args.output_dir.expanduser().resolve()

if not input_path.is_file():
    raise ValueError("The input path must identify an existing regular file.")

output_dir.mkdir(parents=True, exist_ok=True)
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A second description-behavior mismatch indicates the skill may only write pre-existing content into files rather than intelligently processing arbitrary documents as claimed. Misrepresentation of capability and scope can conceal unsafe assumptions, cause users to expose sensitive local content under false pretenses, and bypass informed consent about what the skill really does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A second description-behavior mismatch indicates the skill may only write pre-existing content into files rather than intelligently processing arbitrary documents as claimed. Misrepresentation of capability and scope can conceal unsafe assumptions, cause users to expose sensitive local content under false pretenses, and bypass informed consent about what the skill really does.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill explicitly instructs creating and saving chapter files, summary JSON files, and a master index, but it declares no tool scope or permissions for filesystem access. Undeclared file read/write behavior is risky because it hides operational capabilities from reviewers and users, weakening least-privilege controls and making unintended local data access or modification more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill encourages users to provide full documents for AI summarization and later retrieval workflows without any privacy or data-handling warning. Because the intended inputs are academic or technical documents that may contain unpublished, proprietary, or regulated information, omission of disclosure increases the chance of sensitive data being unnecessarily exposed to AI systems or persisted in generated artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs creation of multiple chapter, summary, and index files but provides no warning that it will write extensively to the user's filesystem. In a document-processing context this increases risk of unanticipated data sprawl, overwriting, leakage into insecure directories, or persistence of sensitive material beyond the user's expectations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The docstring states that the file implements the large-document-reader skill specification. However, the code only performs local chapter extraction plus a single JSON export, which contradicts the documented implication that it implements the full skill behavior described for this skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The top-level docstring and function description present the skill behavior exclusively in Chinese, which can impose a language constraint on users without opt-in. Under the stated policy, forcing a specific language without offering a choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest says the skill splits long documents, generates structured JSON summaries for each chapter, and creates a file system with a global index. This script merely reads one text file, detects headings, prints a chapter list, and dumps chapter metadata/content to a single JSON file; there is no summarization logic or global index creation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes an intelligent large-document reader that splits long academic or technical documents, generates structured JSON summaries, and creates a global index for retrieval workflows. This script instead only reads a preexisting chapters_info.json plus one hard-coded local source document path, then writes chapter markdown files; it does not perform document splitting, summary generation, or index creation here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script writes extracted data to a hard-coded absolute path in the user's home/workspace without prompting, which can cause unintended local file modification or disclosure of document-derived metadata. In an agent-skill context, silent filesystem writes are more concerning because they may persist sensitive information outside the expected execution flow.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.