Back to skill

Security audit

工业招投标技术方案合规审查

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent compliance-review purpose, but its generated HTML reports can embed unescaped document content and its high-stakes compliance claims exceed the implemented checks.

Review this skill carefully before installing. It is not a backdoor, but do not rely on its compliance conclusions without professional review, and avoid opening generated HTML reports from untrusted bid data until the report builder escapes all user-supplied fields or uses an auto-escaping template engine. Pin and audit the Python dependencies before use.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/report_builder.py:490
Finding

Stored HTML and JavaScript Injection in Generated Compliance Reports

Content
View full analysis
{m.get("clause_id", "")} {m.get("section", "")} {m.get("content", "")} {badge} {risk_label} {m.get("finding", "")} ''' ``` Additional values are inserted into both HTML text and attribute contexts: ```python review_rows = "" categories = set() for r in reviews: cat = r.get("category", "技术参数") categories.add(cat) comp = r.get("compliance", "N/A") badge = _compliance_badge(comp) stds = r.get("applicable_standards", []) std_text = "; ".join(stds[:2]) if stds else "—" clause = r.get("clause", {}) review_rows += f''' {r.get("clause_id", "")} {clause.get("section", "")} {clause.get("content", "")[:100]}{"..." if len(clause.get("content","")) > 100 else ""} {cat} {std_text} {badge} {r.get("finding", "")[:150]} ''' # Category filter options category_options = "" for cat in sorted(categories): category_options += f'{cat}' ``` Gap-analysis data is handled in the same unsafe manner: ```python for g in gaps: priority = g.get("priority", "P3") comp = ...[truncated 4353 chars]
Remediation
View remediation
str: return escape(str(value or ""), quote=True) ``` Apply this helper to clause identifiers, sections, content, findings, categories, standards, risk labels, remediation text, project metadata, and all other externally derived strings. 2. **Validate fields that should be enumerations.** Do not accept arbitrary values for fields such as compliance state, project type, grade color, priority, and category. Map recognized values to fixed internal representations and reject or safely replace unknown values. ```python ALLOWED_COMPLIANCE = {"PASS", "PASS*", "UNCERTAIN", "FAIL", "MISSING", "N/A"} comp = raw_comp if raw_comp in ALLOWED_COMPLIANCE else "N/A" ``` 3. **Escape attribute contexts explicitly.** Values used in `data-*`, `value`, `class`, and style attributes must not be inserted directly. Use quoted, HTML-escaped values and restrict class or numeric values to allowlisted formats. 4. **Use a template engine with automatic escaping.** Replace manual formatted-string construction and `str.replace()` templating with an autoescaping template engine such as Jinja2 configured for HTML output. Avoid marking externally derived content as safe. 5. **Constrain numeric presentation values.** Values used for dimensions such as CSS width should be parsed as numbers and clamped to an expected range: ```python rate = max(0.0, min(100.0, float(rate))) ``` 6. **Add a restrictive Content Security Policy as defense in depth.** Refactor inline JavaScript and styles where practical, then add a policy that disallows inline event handlers and unapproved network destinations. CSP must supplement, not replace, correct output encoding. 7. **Add regression tests for injection payloads.** Test every r ...[truncated 399 chars]
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill advertises authoritative compliance review capabilities, document parsing, standards matching, and HTML report generation, but the described implementation appears unable to reliably perform those functions. In a procurement and regulatory context, this can mislead users into trusting incomplete or incorrect compliance results, potentially causing bad bid decisions, missed noncompliance, or false assurances.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description is entirely in Chinese and presents the skill as a fixed Chinese-language experience, with no indication that users may choose another language. Under the policy rule, language constraints should either be optional or explicitly justified as region-specific; neither is stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all headings, instructions, and operational guidance only in Chinese. Under the policy rule for natural-language violations, forcing a specific language without user opt-in can exclude users who do not read that language, and the file does not state that the skill is intentionally limited to a Chinese-speaking or China-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains user-facing natural language in the module docstring entirely in Chinese, including the title and usage instructions. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the constraint is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The top-level docstring shows example invocations using tech_proposal.docx and tech_proposal.pdf, implying native document parsing. However, load_clauses reads JSON only, run_compliance_check documents input_path as a JSON clause file, and the CLI help says 条款JSON输入文件路径, directly contradicting the stated usage examples.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes reviewing uploaded technical proposal documents across formats and producing an interactive HTML compliance report. In this implementation, the pipeline only accepts a clause JSON file (input_path: 条款JSON文件路径), loads JSON clauses, and returns/writes JSON output; there is no document parsing for DOCX/PDF or HTML report generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The argparse description and help strings shown to end users are all in Chinese. Because the file does not offer a language selection mechanism or clearly justify a Chinese-only locale restriction, this is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document title and usage instructions are entirely in Chinese, and the template provides no indication that another language may be used or that Chinese is required for a specific regulatory or regional reason. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file contains natural-language content exclusively in Chinese, which can constitute a language or locale policy issue when the skill or reference material forces a specific language without user opt-in. No surrounding text in the file indicates that the Chinese-only format is optional, user-selected, or required for a region-specific compliance context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This framework presents all instructions and content only in Chinese, with no user opt-in, alternative language option, or explicit justification that the skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and command description are entirely in Chinese, and the generated HTML template also hard-codes Chinese locale/content. This imposes a specific language experience without any user opt-in or documented locale constraint, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower-bound version only, which allows installation of any newer release and makes builds non-reproducible. In a document-processing skill that handles PDFs and office files, this increases supply-chain risk and makes it difficult to determine whether a vulnerable or breaking version may be deployed.

Content

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

text
PyMuPDF>=1.23.0
python-docx>=1.1.0
openpyxl>=3.1.0
pandas>=2.0.0

Unverifiable Dependency: PyMuPDF has 2 known advisory(ies) (CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py); CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

PyMuPDF has known advisories, and because the manifest does not pin the version, there is no way to verify from this file whether the deployed release is affected. This skill's core function involves parsing uploaded PDF documents, so an unverifiable PDF-processing dependency is more concerning than in a non-file-processing context, especially given the referenced path traversal risk.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Using an unpinned python-docx version permits arbitrary newer versions during installation, reducing reproducibility and weakening assurance about what code is actually deployed. Because this skill parses untrusted office documents, dependency drift can expose the system to newly introduced vulnerable behavior or incompatible parser changes.

Content

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

text
PyMuPDF>=1.23.0
python-docx>=1.1.0
openpyxl>=3.1.0
pandas>=2.0.0

Unverifiable Dependency: python-docx has 2 known advisory(ies) (CVE-2016-5851 (Improper Restriction of XML External Entity Reference in python-docx); CVE-2016-5851 (python-docx before 0.8.6 allows context-dependent attackers to conduct XML Exter)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

python-docx has historical XXE-related advisories, and without an exact pinned version the manifest cannot demonstrate that a safe release is in use. Since the skill processes uploaded DOCX files, this context raises the practical risk of XML parser issues, including potential file disclosure or network interaction depending on runtime configuration.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The openpyxl requirement is not fixed to an exact version, so deployments may resolve to different releases over time. For a skill ingesting spreadsheet content from external users, that increases supply-chain uncertainty and can indirectly expose the environment to parser-related flaws present in some versions.

Content

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

text
PyMuPDF>=1.23.0
python-docx>=1.1.0
openpyxl>=3.1.0
pandas>=2.0.0

Unverifiable Dependency: openpyxl has 2 known advisory(ies) (CVE-2017-5992 (Improper Restriction of XML External Entity Reference in Openpyxl); CVE-2017-5992 (Openpyxl 2.4.1 resolves external entities by default, which allows remote attack)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

openpyxl has known XXE-related advisories, but the unpinned dependency prevents verification that an unaffected version is installed. Because the skill is designed to review uploaded technical bid documents and may process spreadsheets, this uncertainty matters more: spreadsheet parsers handling untrusted files are a realistic attack surface.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

A lower-bound-only pandas dependency allows silent upgrades to any later release, which undermines reproducibility and complicates vulnerability management. In a data-processing skill, this can lead to inconsistent behavior across environments and uncertainty about whether a vulnerable dependency is present.

Content

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

text
PyMuPDF>=1.23.0
python-docx>=1.1.0
openpyxl>=3.1.0
pandas>=2.0.0

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
78% confidence
Finding

pandas has a cited advisory history, and the unpinned requirement means the exact deployed version cannot be validated from the manifest. While the referenced issue is less directly tied to this skill's primary document-parsing path than the office/PDF libraries, the lack of version certainty still weakens supply-chain assurance.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.