T01 · Skill Instruction Hijacking
- Location
SKILL.md:12- Finding
Mandatory Verbatim Output Hijacks Agent Responses
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This PDF helper appears purpose-aligned, but it should be reviewed because it can leave extracted document contents in a predictable temporary file while claiming cleanup occurs.
Install only if you are comfortable with local PDF contents being processed by these scripts. Avoid using the documented /tmp/pdf_extract.json workflow for sensitive documents; use a private temporary file or in-memory flow, delete outputs yourself, and install dependencies in a virtual environment with pinned versions where possible.
SKILL.md:12Mandatory Verbatim Output Hijacks Agent Responses
SKILL.md:169Third-Party Dependencies Are Installed Without Version or Integrity Pinning
SKILL.md:73Predictable Shared Temporary File Can Expose Extracted PDF Content
声明与代码部分匹配:文本提取、表格提取、扫描版 OCR 基本都已实现。但代码的实际范围明显更窄,只是一个针对单个 PDF 的提取脚本,并未体现“智能问答”“多文档对比”“批量处理”等声明中的重要能力,因此描述对功能有实质性夸大。此外,代码还会枚举 PDF 中图片并返回图片数量与页面提示,这属于未在声明中明确列出的附加能力。整体上属于描述与实际行为不完全一致,且主要问题是过度声明核心功能。
The skill invokes local Python scripts against user-supplied PDF paths, which implies file-read capability, but it does not declare any explicit tool scope or allowed-tools boundary. This weakens least-privilege controls and makes it easier for the skill to access local files beyond what users may reasonably expect when a PDF-related trigger fires.
The trigger phrases are very broad and overlap with ordinary discussion of PDFs, reports, papers, and document analysis. Overbroad activation can cause the skill to engage unexpectedly and prompt file-handling behavior in contexts where the user did not clearly intend to invoke local document processing.
The file instructs that on first activation the assistant 'must' output a fixed Chinese opening message verbatim. This imposes a language/locale choice on all users without opt-in or an alternative, which is a natural-language policy concern.
The trigger scenario guidance is ambiguous and encourages activation from common natural-language requests like 'read this PDF' or 'analyze report,' without clear confirmation gates. In a skill that reads local files and may process folders in batch, ambiguous activation increases the chance of unintended access to sensitive documents.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
- 加密 PDF 需要密码才能读取,遇到时提示用户
- 扫描版自动检测逻辑:前5页文字量 < 50字/页时判定为扫描版
- 提取结果临时存储在 `/tmp/pdf_extract.json`,用后自动清理
- 中文扫描版识别需要 tesseract 安装 `chi_sim` 语言包:`sudo apt install tesseract-ocr-chi-sim`(Linux)或 `brew install tesseract-lang`(macOS)
The file description and OCR configuration indicate a Chinese-focused skill, and the OCR engines are explicitly invoked with Chinese language packs (chi_sim, ch_sim) plus English. Because the skill does not offer a language/locale choice or clearly justify that it is a region-specific tool, this is a natural-language locale policy concern.
The module docstring says it supports '图片描述', which implies describing image contents. In code, extract_image_descriptions merely enumerates embedded images per page and returns a canned note, with no vision model, OCR-on-images, or content analysis to justify that claim.
The docstring for extract_image_descriptions says '提取PDF中图片并给出描述', suggesting descriptive analysis of images. The implementation only calls page.get_images(full=True) and returns page number, image count, and a generic advisory note, which contradicts the stated behavior.
This code file contains natural-language documentation that assumes a Chinese-speaking user, but it does not provide an opt-in, alternative language, or justification for the locale restriction. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.