T09 · Insecure Skill Coding Practices
- Location
scripts/extract_tables.py:13- Finding
Spreadsheet Formula Injection in CSV and XLSX Exports
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill processes user-provided PDF quotations locally and creates extracted text, image, table, or spreadsheet outputs, with some quality and spreadsheet-safety caveats but no evidence of hidden or malicious behavior.
Install only if you need local PDF quotation/catalog extraction and are comfortable with files being written to the chosen output paths. Treat generated CSV/XLSX files as untrusted when the source PDF is untrusted, and sanitize or review formula-like cells before opening them in spreadsheet software.
scripts/extract_tables.py:13Spreadsheet Formula Injection in CSV and XLSX Exports
声明描述的是一个面向报价单/产品目录的结构化产品信息提取工具,应识别并输出具体商品字段。实际代码使用 pdfplumber 对 PDF 做通用分析,只统计文本、表格、图片和页面级元数据,没有任何针对产品、价格、币种或型号的解析逻辑,也没有生成产品列表。因此其主要用途与声明存在实质性不一致。
声明描述的是一个面向PDF报价单/产品目录的结构化产品数据提取工具,应能提取型号、数量、价格、币种和图片等信息。但实际代码只使用 PyMuPDF 枚举并导出 PDF 内嵌图片,外加基于图像纵横比的简单分析,以及将高图按固定份数垂直切割。代码没有 OCR、文本抽取、表格解析、字段识别或结构化输出逻辑,因此其主要用途与声明不符。虽然声明中包含“图片”提取,但那只是整体产品信息提取的一部分;当前实现缺失核心字段提取能力,属于明显的描述与行为不匹配。
声明描述给人的预期是:该技能能够从PDF报价单或产品目录中提取完整的结构化产品信息(型号、数量、价格、币种、图片)。但代码实际仅自动完成图片提取、按纵向切分、顺序匹配和Excel导出。对于产品的型号、数量、价格,脚本明确要求用户预先在 PRODUCTS_IN_ORDER 列表中手工填写;对于币种,脚本通过命令行提示让用户输入,而不是从PDF中识别。虽然它确实处理PDF并输出包含图片路径和价格等字段的Excel,但这些关键字段并非由PDF内容自动抽取,因此与“从PDF提取产品信息”的核心能力存在实质性不符。此外,脚本只读取 doc[0](第一页),也使其能力比描述的通用“PDF报价单或产品目录提取”更狭窄。综上,这是明显的描述与实际行为不匹配。
声明描述的是一个针对PDF报价单或产品目录的产品信息抽取技能,重点在将内容规范化为特定字段(型号、数量、价格、币种、图片)。但代码实际仅使用 pdfplumber 遍历 PDF 页面并调用 page.extract_tables() 提取表格,把结果以原始表格数据形式保存到 JSON、CSV 或 XLSX。它没有任何针对产品信息字段的识别、映射、清洗或结构化逻辑,也没有图片提取能力。虽然报价单中的产品信息可能位于表格中,因此该代码可作为底层支撑步骤,但其主要功能明显更通用,且缺失声明中的关键能力,因此属于描述与行为不完全一致的明显 mismatch。
该代码块使用 pdfplumber 打开 PDF,遍历页面并调用 extract_text() 提取页面文本,然后将结果打印或写入 txt 文件。它没有任何针对报价单/产品目录的解析逻辑,没有识别产品型号、数量、价格、币种等字段,也没有提取图片或生成结构化数据。因此,声明描述的是一个面向结构化产品信息抽取的技能,而实际代码仅实现了基础的PDF文本抽取,属于明显的描述与行为不一致。
Without declared permissions the skill's intent is opaque and cannot be validated.
The description says to use the skill whenever a user needs structured product data extracted from a PDF quotation or catalog, especially for e-commerce product lists or price tables. This trigger scope is broad and lacks explicit boundaries or negative examples, so it could overlap with many ordinary PDF-processing requests and cause unintended invocation.
The manifest description and the operational instructions are presented in Chinese, and the example user prompt at the end also assumes Chinese-language interaction. There is no indication that the skill offers language selection or that the Chinese-only presentation is a justified regional constraint, which conflicts with the policy against forcing a specific language without user opt-in.
The manifest says the skill is for extracting structured product data from PDF quotations, listing fields like model, quantity, price, currency, and images. However, the documented implementation also creates and saves an Excel workbook containing the extracted data and embedded images, which is an output-generation behavior not described in the manifest.
The manifest describes a focused capability: extracting product information such as model, quantity, price, currency, and images from quotation PDFs or catalogs. This script performs generic table extraction from any PDF and serializes raw table data, without product-specific field extraction or image extraction logic, so the implemented behavior does not match the claimed, narrower purpose.
The manifest says this skill extracts structured product information from quotation PDFs, including model, quantity, price, currency, and images. This file only reads page text with pdfplumber and concatenates it, with no parsing of product attributes, no table/field extraction logic, and no image extraction behavior.
The manifest describes extracting product information from PDF files, including images, but does not mention persisting intermediate image files on disk. The code guidance creates an output directory, writes image files, deletes some of them, and later reuses those paths for Excel embedding, which is broader operational behavior than pure extraction.
This code saves extracted images directly to predictable filenames, and later writes an Excel file, but does not disclose to the user that it will modify files on disk and may replace prior outputs in the target paths. Although file output is central to the script's purpose, there is no clear user-facing warning about overwrite effects or filesystem changes beyond naming the output arguments.
The manifest describes using the skill to extract structured product data from PDFs, which implies reading and transforming document contents. This script additionally persists extracted content to an arbitrary output file when requested, a behavior not reflected in the manifest description.