Back to skill

Security audit

pdf-fin-parse

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated finance-PDF parsing purpose, but it needs review because it uploads sensitive financial PDFs to external services, leaves cloud uploads without cleanup controls, and installs dependencies from an unreviewed parent path.

Review this before installing with confidential documents. Use a dedicated least-privilege TOS bucket and credentials, confirm the bucket has short lifecycle expiration, avoid custom endpoints unless you control them, and do not run the provided pip install until the dependency manifest is included and pinned inside the skill package.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:59
Finding

Dependency Installation Relies on an Unreviewed Manifest Outside the Skill Package

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tos_uploader.py:98
Finding

Uploaded Financial PDFs Are Retained Without Cleanup or Expiration Controls

Content
View full analysis
str: """Upload a local PDF to TOS and return tos://bucket/key.""" try: import tos except ImportError as e: raise TOSConfigError( "tos SDK is not installed. Run: pip install tos\n" "or see: https://www.volcengine.com/docs/6349/74982" ) from e p = Path(local_path) if not p.is_file(): raise FileNotFoundError(f"Local file does not exist: {local_path}") ak, sk = _credentials() tos_region = _resolve_tos_region(region) ep = _endpoint(tos_region) bk = _bucket(bucket) key = _gen_key(local_path, prefix) client = tos.TosClientV2(ak, sk, ep, tos_region) try: size_mb = p.stat().st_size / 1024 / 1024 _log(f"[tos] uploading {p.name} ({size_mb:.2f} MB) -> tos://{bk}/{key}") with open(p, "rb") as f: client.put_object(bk, key, content=f) url = f"tos://{bk}/{key}" _log(f"[tos] upload ok") return url except tos.exceptions.TosClientError as e: raise RuntimeError(f"TOS client error: {e.message}, cause: {e.cause}") from e except tos.exceptions.TosServerError as e: raise RuntimeError( f"TOS server error: code={e.code}, message={e.message}, " f"request_id={e.request_id}, status={e.status_code}" ) from e finally: try: client.close() except Exception: pass ``` The implementation closes the TOS client but does not delete the uploaded object. The orchestration in `scripts/skill.py:549-563` resolves a local input by uploadin ...[truncated 2091 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (55)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a full financial-document parsing pipeline specialized for annual reports and filings, with multiple finance-oriented post-processing stages and structured output generation. The supplied code chunk, however, is a narrow utility for detecting two-column page layouts and reordering text blocks accordingly on a single page. While layout reordering could be a supporting subcomponent of a PDF parser, this chunk does not itself implement the core advertised behavior such as PDF parsing, table extraction, financial normalization, or Markdown/JSON output. Therefore, the code chunk does not accurately represent the declared purpose on its own.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

声明描述的是一个完整的金融 PDF 结构化解析技能,核心特征包括调用外部 LAS 解析算子、面向整篇文档输出 Markdown + JSON、并在其后进行多层金融语义后处理与规则校验。而实际代码片段的职责明显更窄:它只处理 PDF 中的表格抽取与跨页合并,依赖 pdfplumber,本地启发式识别表头/合并单元格/无边框表,并给出表格级置信度。虽然其中确实覆盖了声明中的部分子能力,如跨页表格、多级表头、HTML 表格输出,也明显面向财报场景,但缺少声明中最关键的系统级行为:通用 PDF 解析、LAS 调用、JSON schema 输出、财务术语对齐与业务规则校验。因此描述与该代码片段存在实质性不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a full financial PDF-to-Markdown/JSON extraction skill, specialized for complex financial documents and post-processing. The actual code chunk is a narrow utility that renders already-structured table cell data into HTML. While HTML table handling could be a supporting component within a larger financial parsing pipeline, this chunk by itself does not implement the declared primary purpose and instead performs a materially different function: reverse-serializing structured cells to HTML for evaluation or annotation assistance. Therefore, the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码片段的实际功能是一个 LAS PDF 解析远程服务客户端,负责 API 鉴权、构造 submit/poll 请求、重试退避、状态轮询和错误处理。这与声明中描述的完整金融 PDF 解析与金融后处理能力存在明显差距。虽然声明提到底层会调用 las_pdf_parse_doubao 算子,这与代码一致,但代码本身并未体现上层金融领域特化处理与最终结构化输出逻辑。因此描述不能准确代表此代码块的实际行为,属于能力夸大/范围不符型 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向金融文档的高层解析能力:从 PDF 中提取结构化内容并输出 Markdown/JSON,且包含复杂表格和金融语义后处理。但给出的代码文件只是底层渲染模块,负责读取 PDF/图片、统计页数、将页面转成 PNG bytes,并处理加密和图片格式转换。代码注释还明确说明“只做渲染,不抽取任何内容”。因此,按所提供代码片段来看,其实际行为与声明的主要用途存在明显且实质性的不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个较完整的金融 PDF 解析与后处理系统,而实际代码片段只是 prompts.py,作用是生成给模型的输出约束提示词。它确实与金融文档结构化抽取相关,且覆盖了表格、多级表头、跨页、数值规整等部分目标,因此并非完全无关;但其实际行为与声明的核心实现路径存在明显偏差:声明强调 PDF 解析 + LAS 算子 + 6 层后处理,本代码却仅定义‘一页渲染图 → 直接输出 JSON’的提示模板,并明确写明‘本地不再加工’。这与声明中的主要架构和能力表述不一致,属于描述与代码行为的实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码块与声明存在明显描述-行为不一致。声明描述的是一个面向复杂金融 PDF 的主解析能力,依赖外部 LAS 算子并具备复杂表格、跨页、多级表头等金融后处理能力;而实际代码是“rule_extractor”,定位为 router 的替代路径,只处理简单页面,且注释中反复说明复杂场景应路由给 VLM。代码没有任何 LAS/API 调用,也没有实现跨页合并、无边框表解析、多级表头恢复、复杂业务规则校验等声明中的核心能力。因此这不是细节实现差异,而是主要能力边界和技术路线都不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

声明将该技能描述为一个以 LAS las_pdf_parse_doubao 为底层核心、再做 6 层金融后处理的金融 PDF 解析器。但代码的主实现并不一致:默认 parse 流程走的是按页分析后路由到 rules 或 VLM 的混合引擎,且注释明确写着“不做规则解析,所有理解委托给多模态视觉模型”与实际 imports/routing 一起表明其核心是 AI-first/混合解析,而不是统一以 LAS 为底层。真正调用 LAS 的仅是 parse-las 子命令,属于另一条专门路径。此外,后处理在代码里只出现在 parse-las,且是 no_postprocess 可跳过、异常也不阻塞原始输出的 best-effort 逻辑,不符合描述中像是固定产品能力的“6 层金融后处理输出 schema-compliant JSON”。因此,描述准确覆盖了代码的一部分能力,但夸大并错置了主要实现路径,属于实质性描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个完整的金融 PDF 解析器,核心能力应包括文档内容抽取、复杂表格解析、金融语义后处理以及结构化结果输出。但提供的代码块只是一个 TOS 上传工具:读取环境变量中的 TOS 凭证和桶配置,生成对象 key,将本地 PDF 上传到 TOS,并把输入统一转换为 LAS 可接受的 URL;附带获取 PDF 页数和文件大小等元数据。这属于解析流程的前置支持组件,而不是声明中的主要功能本身。虽然注释提到“本地 PDF 必须先上传 TOS 才能调用 LAS”,表明它可能服务于更大系统,但就该代码块实际行为而言,与所声明的解析/结构化输出能力存在明显且实质性的描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

这段代码的核心职责是“VLM 调用客户端”,而不是完整的金融 PDF 解析流水线。它负责:构建多模态消息、调用兼容 OpenAI 的聊天补全接口、处理 response_format、做重试、解析 JSON,以及额外提供一个基于模型的数值/单位修复函数。虽然这些能力可作为更大 PDF 解析系统的一部分,也与金融文档结构化抽取场景相关,但仅凭该代码无法支持声明中的关键内容:PDF 文档级处理、LAS 算子调用、跨页合并、多级表头恢复、HTML 表格解析、财务术语对齐、业务规则校验等。因此描述对该代码块所做事情有明显夸大和不准确之处,属于实质性不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares executable behavior that requires environment variables, file access, network access, and output writing, but it does not define any explicit tool scope such as permissions or allowed-tools. This creates an overbroad execution surface where an agent may invoke the skill with more capabilities than users expect, increasing the risk of unintended data access or exfiltration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language description is written entirely in Chinese and the workflow and reply template also prescribe Chinese interaction, but there is no statement that the skill is China-specific or that users may choose another language. This can violate language/locale policy when a skill implicitly enforces a language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation indicates that local PDFs must be uploaded to TOS and then parsed by LAS, but it does not present this as a clear user-facing warning in the skill description. For financial PDFs, this can expose confidential reports, deal materials, or regulated data to external cloud services without informed consent, creating a significant privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file provides a fixed Chinese response template for reporting results and does not indicate that the language should follow user preference. A mandatory response language without opt-in is a natural-language policy issue unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s natural-language guidance, including the module docstring and explanatory comments, is entirely in Chinese and presents the skill behavior in that locale only. Under the stated policy, forcing a specific language without offering a user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code automatically routes scanned pages to extract_tables_via_vlm(...) when API credentials are present, sending PDF page content to an external VLM service without any explicit user confirmation or prominent warning at the call site. In a finance-PDF parser, documents commonly contain material nonpublic information, PII, and regulated financial data, so silent external transmission creates a real confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code base64-encodes a rendered PDF page and sends it to a remote VLM endpoint via an OpenAI-compatible API. For a finance PDF parser, pages can contain confidential financial statements, nonpublic disclosures, or regulated data, so external transmission without explicit consent, data-classification checks, or provider allowlisting creates a real data exfiltration/privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The schema's natural-language constraint only permits Chinese, English, or mixed output. Because no user opt-in, alternative locale support, or documented justification appears in the file, this constitutes a language/locale policy concern under the rule for natural-language policy violations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · env.sh (reported line 33)May include surrounding context.

sh
# 选项 C: OpenAI 兼容端点
# export OPENAI_API_KEY="sk-..."
# export OPENAI_BASE_URL="https://api.openai.com/v1"

# 选项 D: 本地 Ollama
# export VLM_PROVIDER="ollama"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language prompts and expected outputs are written in Chinese throughout the eval manifest, which implies the skill is expected to operate in a fixed language/locale. Under the policy, forcing a specific language without offering user choice or documenting a justified regional constraint is a violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger examples are permissive and define activation mostly by examples rather than explicit boundaries, which can cause the skill to trigger on loosely related PDF requests outside the intended financial-report parsing scope. In an agent setting, over-broad triggering can route sensitive or unintended documents into this parser pipeline, increasing the chance of incorrect tool use, unnecessary data exposure, or unsafe downstream processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file presents all operational guidance and troubleshooting in Chinese, and does not indicate that other languages are available or that the user can choose their preferred language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest says the skill performs '跨页合并' as part of its financial post-processing pipeline. However, this FAQ explicitly says '本 Skill 当前不在本地合并' and instructs users to do merging in the evaluation layer instead, which is a direct contradiction between documentation of intended behavior and stated skill capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language documentation in the module and function docstrings is entirely in Chinese, which imposes a specific language/locale on users and maintainers without offering any choice or documenting a justified regional constraint. The policy explicitly allows locale constraints only when opt-in or clearly justified; neither is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file’s user-facing natural language is entirely in Chinese in the module docstring and throughout explanatory comments/docstrings. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation, and this file does not indicate any optional language selection or region-specific justification.

Content

No source excerpt is available for this finding.