Back to skill

Security audit

投标文件全流程智能分析

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for tender analysis, but it has review-worthy risks around unsafe generated HTML reports and persistent local storage of sensitive bid materials.

Review before installing in environments with confidential bid data. Use a dedicated working directory, avoid opening generated HTML reports from untrusted tender files until output escaping is fixed, pin dependencies, and periodically delete .tender_versions and outputs when no longer needed.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/report_builder.py:69
Finding

Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
str: """构建项目概览卡片""" items = [ ("项目名称", info.get("project_name", "未提取")), ("项目编号", info.get("project_number", "未提取")), ("预算金额", info.get("budget", "未提取")), ("招标人", info.get("bidder", "未提取")), ("投标截止", info.get("bid_deadline", "未提取")), ] cards = "".join( f'
{label}{value}
' for label, value in items ) return f'

项目概览

{cards}
' def _build_requirements_table(requirements: list[dict]) -> str: """构建需求清单表格""" if not requirements: return '

需求清单

暂未提取需求

' rows = "" for req in requirements: mandatory_icon = "★" if req.get("mandatory") else "" risk_class = f"risk-{req.get('risk_level', 'low')}" rows += ...[truncated 2425 chars]
Remediation
View remediation
str: return escape(str(value if value is not None else ""), quote=True) ``` 2. Use the encoder for project metadata, requirements, review content, revision data, version metadata, and risks. 3. Replace direct string construction with a template engine such as Jinja2 configured with automatic escaping: ```python from jinja2 import Environment, FileSystemLoader, select_autoescape env = Environment( loader=FileSystemLoader(template_directory), autoescape=select_autoescape(["html", "xml"]), ) ``` 4. Do not allow arbitrary values in HTML classes or style attributes. Map risk levels through a strict allowlist: ```python allowed_risks = {"low", "medium", "high", "critical"} risk_level = req.get("risk_level", "low") if risk_level not in allowed_risks: risk_level = "low" ``` 5. Validate numeric fields before using them in CSS properties such as progress-bar widths, and clamp percentages to the range `0` through `100`. 6. Add a restrictive Content Security Policy. Prefer moving the inline script into a local static file and disallowing inline event handlers. 7. Add automated tests using payloads in every output field, including closing tags, quoted attribute payloads, SVG payloads, and malformed CSS values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/version_manager.py:35
Finding

Snapshot Path Traversal Through Unsanitized Project Names

Content
View full analysis
Remediation
View remediation
str: value = str(value) if "/" in value or "\\" in value or ".." in value: raise ValueError("Project name contains prohibited path components") value = re.sub(r"[^A-Za-z0-9._-]", "_", value).strip("._") if not value: raise ValueError("Project name is empty after sanitization") return value ``` 2. Resolve and verify containment immediately before opening the file: ```python base = self.versions_dir.resolve() snapshot_path = (base / snapshot_name).resolve() if snapshot_path.parent != base: raise ValueError("Snapshot path escapes the version repository") ``` 3. On supported Python versions, use `Path.is_relative_to()` for containment checks. 4. Reject absolute paths and platform-specific drive or UNC path syntax. 5. Use `"x"` mode if snapshots must never overwrite existing files. 6. Do not derive `project_name` directly from tender metadata without sanitization. 7. Store only repository-relative snapshot paths in `version_index.json`, and validate them again before later reads. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:5
Finding

Unpinned and Unhashed Third-Party Dependencies

Content
View full analysis
=1.21.0 python-docx>=0.8.11 openpyxl>=3.0.10 # Data processing (数据处理) pandas>=1.5.0 numpy>=1.24.0 ``` The README additionally recommends unconstrained installation: ```bash pip install pymupdf python-docx openpyxl pandas numpy ``` ### Technical Analysis A requirement such as `pymupdf>=1.21.0` permits the package resolver to install any later release. Therefore, installations performed at different times may execute materially different code despite using the same reviewed Skill package. No malicious or typosquatted package was identified in the audited manifest, and the listed names correspond to conventional packages. The confirmed weakness is the absence of reproducible dependency controls, not evidence that the current packages are malicious. Python packages may execute build or installation logic during installation. Open-ended resolution also risks automatically selecting a future compromised release, an incompatible major release, or a release containing a newly introduced vulnerability. ### Attack Path 1. A user follows the README installation command or installs from `requirements.txt`. 2. The package resolver queries its configured package index and selects currently available versions satisfying the minimum constraints. 3. A future compromised, vulnerable, or incompatible version satisfies those constraints. 4. Package build or installation code executes with the privileges of the user running `pip`. 5. The compromised dependency is subsequently imported while parsing potentially sensitive tender documents. ### Impact Assessment If a selected dependency release is compr ...[truncated 422 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad end-to-end tender/bid analysis platform with document parsing, analytical decomposition, chart generation, scoring, auto-revision, and version control features. The supplied code chunk only covers one sub-feature: generating revision patches from review comments. It does not read or parse office/PDF files, does not analyze tenders structurally, does not generate any diagrams, does not score submissions, and does not implement Git-like versioning. While the auto-revision aspect is consistent with part of the description, the actual code's primary purpose is much narrower than the declared purpose, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a comprehensive end-to-end tender/bid analysis system. The supplied code, however, is limited to one sub-function: simulated multi-expert scoring of pre-structured requirements. While expert scoring and deduction output are consistent with part of the description, the primary declared scope includes document parsing, structured decomposition, diagram generation, automatic modification, and version tracking, none of which appear in this code. Therefore the description materially overstates the behavior of the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个覆盖文档解析、需求拆解、图表生成、评分、修订和版本跟踪的完整投标分析平台;但所给代码块只包含一个独立的MECE分析脚本。它接收已结构化的需求JSON,而不是原始招投标文档;输出是分类统计、交叉影响、隐含需求和建议,没有发现任何文档解析库、图表渲染、评分引擎、修订逻辑或版本控制实现。因此代码行为与声明的主要目的和关键能力存在明显且实质性的缺口,应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a comprehensive end-to-end tender/bid analysis system with advanced analytical and generative features. The supplied code only implements document parsing for PDF/DOCX/XLSX and simple keyword/pattern extraction. It does not contain any logic for structured requirement breakdown, chart generation, scoring simulation, revision workflows, or version tracking. The parsing aspect is consistent with part of the description, but the overall declared purpose substantially overstates the implemented functionality, making this a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/report_template.html (reported line 1)May include surrounding context.

html
<!--
Tender Analyzer — HTML Report Template
投标分析报告基础模板,含完整CSS样式和JS交互框架
使用时替换 {{PLACEHOLDER}} 变量

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/report_template.html (reported line 1)May include surrounding context.

html
<!--
Tender Analyzer — HTML Report Template
投标分析报告基础模板,含完整CSS样式和JS交互框架
使用时替换 {{PLACEHOLDER}} 变量

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The listed trigger phrases lack scope constraints and exclusion rules, so normal requests like scoring, modifying documents, generating diagrams, or saving versions could invoke the skill even when the user is not working on tender materials. In an agent setting, ambiguous invocation boundaries can route unrelated sensitive documents into a workflow that performs parsing, evaluation, and automatic revision, creating integrity and privacy risks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrase "生成架构图" is generic and can match many unrelated user requests, causing this skill to activate outside its intended tender-analysis scope. Because the skill can parse documents, generate reports, and perform automated modifications, over-broad activation increases the chance of unintended handling of arbitrary files or workflows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares file read/write behavior and local persistence semantics throughout the workflow, but it does not define an explicit tool scope such as allowed-tools or permissions. That creates an authorization ambiguity where an agent may over-assume it can access or write local files, increasing the risk of unintended access to sensitive tender materials or uncontrolled artifact creation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill description and all operational guidance are written as a Chinese-only experience, while also including English trigger terms like "bid", "tender", and "RFP analysis". This creates a language-policy concern because users may invoke the skill in English but are not offered a choice of output language or locale.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is very broad and overlaps with common procurement and document-help requests, making accidental activation more likely. In a skill that reads files, writes outputs, stores snapshots, and may invoke scripts, ambiguous activation increases the chance of processing sensitive content or creating artifacts when the user did not intend to invoke this specific workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The capability matrix includes ambiguous examples like generic requests for analysis, diagrams, and scoring without clear gating conditions. Because this skill includes persistence and potential script execution, unclear activation boundaries can cause unintended handling of confidential bid documents or unnecessary local file creation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill stores local version snapshots of bid materials but does not clearly warn users that sensitive tender content may be retained on disk. Tender documents often contain confidential pricing, credentials, legal terms, and strategic information, so silent persistence materially raises data exposure risk on shared or unmanaged systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generated HTML reports are saved to disk and are likely to embed extracted procurement data, scoring results, and revision history, yet the skill does not clearly disclose that risk. Persisted single-file reports can be easily copied or opened later by other local users, increasing confidentiality and compliance exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly instructs use of an external local Python interpreter and helper scripts, which introduces code-execution capability into a workflow handling sensitive documents. If the scripts or arguments are influenced by document content or user input, this can expand the attack surface to arbitrary local code execution, unsafe file access, or execution of unreviewed dependencies.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The HTML root declares lang="zh-CN", which hard-codes a specific language/locale for the generated report. Under the policy rule, forcing a locale without offering user opt-in or documenting a justified region-specific constraint is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code presents the skill purpose and behavior entirely in Chinese, and the parsing logic is also built around Chinese review-comment keywords, implying a fixed language/locale behavior. The file does not offer a user opt-in or language choice, and no region-specific justification is documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Natural-language policy violations apply to all file types, including code comments, docstrings, and user-facing strings. Here, the top-level description and later CLI/help text are Chinese-only, which effectively forces a specific language for users without any opt-in or stated region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file contains user-facing CLI descriptions and help strings that are fixed to a specific language context rather than offering user choice. Under the language/locale policy rule, this is a violation unless the locale constraint is clearly documented and justified or the user can opt into it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated HTML template is explicitly fixed to lang="zh-CN" and uses Chinese-only report labels and title text. This imposes a specific language/locale on all users without any visible option to select another language, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This markdown file presents all instructions and framework content exclusively in Chinese, with no opt-in, alternative language option, or stated region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and later user-facing output are written in Chinese, and the rating strings and review messages are hard-coded in Chinese throughout the script. This imposes a specific language/locale on users without any opt-in or documented justification, which matches the language-policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The deduction reasons and improvement suggestions returned to users are fixed Chinese strings, and the same pattern continues in the rating labels. Because the script provides no mechanism to select another language, it enforces a locale-specific experience without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This requirements file contains bilingual Chinese comments such as "投标文件智能分析技能" and other Chinese annotations, but there is no indication that the skill offers language choice or that the locale constraint is explicitly justified. Under the stated policy, forcing or assuming a specific language without user opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Using an unpinned dependency such as pymupdf>=1.21.0 allows builds to resolve to different future versions, including versions with newly introduced vulnerabilities or breaking security behavior. In this skill, the package processes untrusted document inputs, so dependency drift increases supply-chain and parser-exposure risk.

Content

Scanner excerpt · scripts/requirements.txt (reported line 5)May include surrounding context.

text
# 投标文件智能分析技能 - Python依赖包

# Document parsing (文档解析)
pymupdf>=1.21.0
python-docx>=0.8.11
openpyxl>=3.0.10

Static analysis

No suspicious patterns detected.