T09 · Insecure Skill Coding Practices
- Location
src/pdf_intelligence_suite/tables.py:126- Finding
Spreadsheet Formula Injection in CSV and Excel Exports
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This PDF tool mostly matches its stated purpose, but it has real unsafe export and file-handling issues that users should review before installing.
Review before installing. Use this only on PDFs you are authorized to process, avoid running the example script in directories with important files, do not open generated HTML or spreadsheet files from untrusted PDFs without sanitizing them first, and do not rely on the current permission-restriction API to enforce PDF copy/print limits.
src/pdf_intelligence_suite/tables.py:126Spreadsheet Formula Injection in CSV and Excel Exports
src/pdf_intelligence_suite/converter.py:259Stored HTML Injection in PDF-to-HTML Conversion
{text}` element does not provide an escaping boundary. Attacker-controlled text containing markup such as a closing `
examples/basic_usage.py:145Executable Example Can Overwrite and Delete Pre-existing User Files
src/pdf_intelligence_suite/security.py:64Requested PDF Permission Restrictions Are Calculated but Never Applied
The broader mismatch suggests the skill may perform undeclared page manipulation, security changes, and conversions to formats different from those promised, while declared core capabilities are not evidenced. In security terms, this is a trust-boundary problem: the user is induced to approve a tool under one mental model while actual behavior may be substantially different and more invasive.
The broader mismatch suggests the skill may perform undeclared page manipulation, security changes, and conversions to formats different from those promised, while declared core capabilities are not evidenced. In security terms, this is a trust-boundary problem: the user is induced to approve a tool under one mental model while actual behavior may be substantially different and more invasive.
The broader mismatch suggests the skill may perform undeclared page manipulation, security changes, and conversions to formats different from those promised, while declared core capabilities are not evidenced. In security terms, this is a trust-boundary problem: the user is induced to approve a tool under one mental model while actual behavior may be substantially different and more invasive.
The broader mismatch suggests the skill may perform undeclared page manipulation, security changes, and conversions to formats different from those promised, while declared core capabilities are not evidenced. In security terms, this is a trust-boundary problem: the user is induced to approve a tool under one mental model while actual behavior may be substantially different and more invasive.
The broader mismatch suggests the skill may perform undeclared page manipulation, security changes, and conversions to formats different from those promised, while declared core capabilities are not evidenced. In security terms, this is a trust-boundary problem: the user is induced to approve a tool under one mental model while actual behavior may be substantially different and more invasive.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 安装Tesseract OCR(用于OCR功能)
# Ubuntu/Debian:
sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-chi-tra
# macOS:
brew install tesseract tesseract-lang
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 安装Tesseract OCR(用于OCR功能)
# Ubuntu/Debian:
sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-chi-tra
# macOS:
brew install tesseract tesseract-lang
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 安装Tesseract OCR(用于OCR功能)
# Ubuntu/Debian:
sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-chi-tra
# macOS:
brew install tesseract tesseract-lang
This markdown file documents security-sensitive operations such as decrypting PDFs and modifying protected documents, but it provides no user warning about confidentiality risks, password handling, or the need to ensure authorization before removing protection. It also omits any caution that page-removal and related manipulation operations can alter document contents in ways that may affect data integrity.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
A: 确保已安装中文语言包:
# Ubuntu
sudo apt-get install tesseract-ocr-chi-sim tesseract-ocr-chi-tra
# macOS
brew install tesseract-lang
The skill advertises capabilities that inherently read from and write to local files, but it does not declare any explicit tool scope or permissions. This creates an authorization and review gap: users and automated policy systems cannot easily tell that the skill may access or modify files, which increases the chance of unintended document exposure or modification.
The skill describes page operations and metadata management but omits warnings that these actions can permanently modify, remove, or expose document content and metadata. In a PDF-processing context this is meaningful because users may assume non-destructive analysis, while the skill can affect document integrity, confidentiality, and auditability.
The manifest describes the skill as a PDF processing suite for text extraction, table recognition, OCR, and PDF-to-Word/Excel conversion. This file also showcases page-manipulation features such as merge, split, rotate, delete, reorder, and extraction, plus encryption/decryption and watermarking, which are materially broader capabilities than the manifest advertises.
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
# 调整列宽
for col in ws.columns:
max_length = 0
column = col[0].column_letter
for cell in col:
try:
The HTML export embeds extracted PDF text directly inside a
element without escaping HTML special characters. If a PDF contains attacker-controlled text such as
The manifest describes a PDF intelligence suite focused on text extraction, table recognition, OCR, and PDF-to-Word/Excel conversion. This module instead implements broad PDF page editing operations such as merge, split, rotate, delete, insert, reorder, and duplicate, which are materially different document-manipulation capabilities rather than the stated extraction/recognition/conversion functions.
This code file contains natural-language docstrings and messages exclusively in Chinese, including the module description and later exception text. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.
This code reads a user-supplied PDF, converts its pages to images, and extracts full text content, which can include sensitive personal or business data. While the function has technical docstrings, there is no user-facing warning, confirmation, or disclosure about processing document contents or the privacy implications of OCR.
The function extracts not only recognized text but also confidence scores and bounding-box metadata for each token, increasing the sensitivity of the produced output. There is no visible warning, logging, or user disclosure indicating that detailed document content and layout information will be extracted and returned.
The decrypt method removes PDF encryption and writes the resulting plaintext document to output_path, which is a safety-relevant file write affecting document confidentiality. Although the function has a docstring, there is no explicit user-facing warning, confirmation, or disclosure that a protected document will be saved in decrypted form.
The natural-language content in the module and method docstrings is exclusively Chinese, with no indication that users may choose another language. Under the policy provided, forcing a specific language without opt-in is a natural-language policy violation.
The natural-language skill documentation appears to force a specific language for all user-facing instructions and examples. Under the stated policy, this is a locale/language constraint unless the skill offers user choice or clearly documents why the restriction is necessary.
This code file includes natural-language strings and documentation that assume a specific language/locale presentation, primarily Chinese, with bilingual support added but no user-selectable locale behavior. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy issue.
The file includes a Chinese-only descriptive comment alongside the English title, and multiple subsequent section headers are written only in Chinese. For a general-purpose skill artifact, this suggests a language preference is being imposed without any stated opt-in or locale-specific justification, which can conflict with language/locale policy expectations.
Using a lower-bound specifier like ">=" for PyPDF2 makes builds non-reproducible and can silently resolve to vulnerable or breaking versions over time. In a PDF-processing skill that handles untrusted documents, dependency drift is more dangerous because parser vulnerabilities are a common attack surface.
# PDF智能处理套件依赖声明
# PDF处理核心库
PyPDF2>=3.0.0
pdfplumber>=0.10.0
camelot-py>=0.11.0
No suspicious patterns detected.