Back to skill

Security audit

Bid Proposal

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended for Chinese bid-proposal drafting, but it should be reviewed because it automatically processes Word files and reuses imported materials in prompts without strong scoping or trust boundaries.

Install only if you are comfortable with the skill handling sensitive tender and proposal materials. Use explicit commands, avoid sending unrelated .docx files into the chat, review imported material before reuse, remove confidential client names/pricing/internal costs, and prefer a pinned dependency in an isolated environment.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/prompt_builder.py:221
Finding

Untrusted Material Content Is Inserted Directly into AI Prompts

Content
View full analysis

Vulnerability Details

File Location: scripts/prompt_builder.py:221-229
Vulnerability Type: Indirect prompt injection through imported reference material
Risk Level: Medium

Vulnerable Code

python
for fname, content in materials:
    # Truncate long content to reasonable reference size
    excerpt = content[:2000]
    if len(content) > 2000:
        excerpt += '\n\n...(内容已截断,完整内容见素材库)'
    lines.append(f"### 参考:{fname}")
    lines.append(excerpt)
    lines.append('')

Technical Analysis

The prompt builder reads material-library files and concatenates their content directly into the operative AI prompt. Although content is truncated to 2,000 characters, it is not escaped, classified as untrusted data, or enclosed within a security boundary that instructs the model not to execute embedded directives.

Material files can originate from user-selected imports under the workflow documented in SKILL.md. An attacker-controlled file can therefore include instructions such as requests to disregard the proposal-writing task, reveal surrounding prompt context, fabricate claims, or append unrelated content. When a matching chapter is generated, those instructions become part of the model prompt and may compete with legitimate writing directives.

This is an insecure prompt-construction practice rather than evidence that the bundled material is itself malicious. No malicious prompt-injection instructions were identified in the currently included material files.

Attack Path

  1. An attacker supplies a crafted Markdown or text document presented as legitimate proposal reference material.
  2. The user imports that document into a searched material-library directory such as chapter-examples or past-projects.
  3. The attacker selects a filename sufficiently similar to a target chapter so that find_material_references() matches it.
  4. The function reads the file without validating its semantic ...[truncated 961 chars]
Remediation
View remediation

Remediation Suggestions

  1. Treat every imported material file as untrusted data, regardless of its source or filename.
  2. Enclose reference content in explicit delimiters and place an instruction immediately before and after it stating that embedded commands are data and must not be followed.
  3. Separate trusted writing instructions from untrusted reference content using distinct structured fields or model-message roles where the AI integration supports them.
  4. Detect and quarantine common instruction-hijacking patterns, including requests to ignore previous instructions, reveal prompts, change roles, invoke tools, or append unrelated content.
  5. Require user confirmation before using newly imported material and display its filename, origin, and detected risk indicators.
  6. Preserve source provenance so generated claims can be traced back to the tender document or an approved internal source.
  7. Add adversarial tests containing malicious instructions in matched material files and verify that those instructions are quoted or ignored.
  8. Do not rely on the existing 2,000-character truncation as a security control; a complete malicious instruction can fit well within that limit.

T08 · Insecure Dependencies

Note
Location
SKILL.md:27
Finding

Unpinned Runtime Dependency Installation Lacks Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:27
Vulnerability Type: Uncontrolled third-party dependency resolution
Risk Level: Low

Vulnerable Code

markdown
- Python environment: `pip3 install python-docx`

Technical Analysis

The documented installation command retrieves whichever python-docx release the active pip index resolves at installation time. It does not specify a reviewed version, validate a cryptographic hash, use a lock file, or constrain the package index to a trusted source.

This produces non-reproducible installations and exposes users to dependency drift, package-index misconfiguration, and supply-chain compromise. The package name itself is legitimate, and the audit found no evidence that the project intentionally installs a malicious dependency. The risk arises from the absence of version and integrity controls.

Attack Path

  1. A user follows the documented installation command.
  2. pip resolves the dependency through the user's configured package index or mirror.
  3. A compromised index, malicious mirror, or compromised future package release supplies altered package content.
  4. The package is installed without hash verification.
  5. Third-party code executes when the project imports and uses the DOCX library, with the permissions of the user running the scripts.

Exploitation requires compromise or malicious control of the dependency source or resolved release; it is not directly achievable through ordinary proposal input alone.

Impact Assessment

A malicious dependency would execute with the privileges of the Python process. Depending on the runtime account, this could permit access to files readable by that account, modification of writable project or user files, environment-variable access, and network communication allowed by the host.

The reviewed repository does not itself request elevated privileges and contains no dependency-installation automation, ...[truncated 53 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin python-docx to a reviewed, exact version in a dependency file.
  2. Generate and enforce cryptographic hashes, such as through a hash-locked requirements.txt.
  3. Install with hash enforcement, for example using pip install --require-hashes -r requirements.txt.
  4. Document the approved package index and avoid untrusted or implicit mirrors.
  5. Perform installation in an isolated virtual environment with minimal filesystem and network privileges.
  6. Add automated dependency vulnerability and provenance scanning to the release process.
  7. Review and deliberately update the pinned version rather than resolving the latest release during each installation.
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 (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的核心能力是“编写投标技术方案”,包括完整写作工作流:需求分析→大纲推荐→逐章生成→Word输出。但提供的代码仅做前置需求分析,属于文档解析/信息抽取脚本。它会读取纯文本或.docx,识别评分项、技术关键词、项目名称、场景类别和特殊说明,并以JSON或文本形式输出结果。代码中没有任何生成投标方案内容、推荐方案大纲、分章节写作、协作流程控制或导出Word文档的实现。虽然“需求分析”是声明流程中的一个子步骤,且与投标场景相关,但该代码的主要行为明显局限于分析,不足以支撑声明的整体功能,因此描述与实际行为存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个完整的投标方案写作技能,核心能力应包括根据用户请求生成投标方案内容并支持协作式流程和Word输出。但所给代码块仅为单元测试文件,测试 analyze_text、analyze_docx、match_scene、extract_scoring_items 等函数对招标文本进行解析、场景识别和评分项提取的行为。虽然“需求分析”与声明中的第一步有一定相关性,且测试样例覆盖了安全服务、产品交付、等保测评等场景,但代码体现的实际主功能是前置分析,而不是投标方案编写工作流。因此,描述与代码行为存在明显且实质性的不匹配。

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Automatically triggering on any sent .docx file is insufficiently scoped and can cause the skill to process documents the user did not intend for this workflow. In this skill, that is especially dangerous because uploaded Word files may contain sensitive procurement, legal, pricing, or internal company data, and the workflow then performs analysis, persistence, and possible reuse via materials or saved state without an explicit opt-in boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This section describes pervasive internal-network monitoring, malicious IP scoring, detection of internal lateral movement, and inspection of HTTPS-encrypted traffic without any explicit employee/privacy notice, governance boundary, or lawful-use limitation. Because encrypted-traffic and behavioral monitoring can expose employee communications, credentials, and sensitive business activity, the omission is materially risky in an enterprise service template.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs the agent to read and write files and invoke shell-based Python scripts, but it does not declare an explicit tool/permission scope. That creates an authorization ambiguity where an agent may exercise broader filesystem or shell access than reviewers or users expect, increasing the chance of unintended file access, overwrite, or command execution. In this context, the risk is elevated because the workflow explicitly processes uploaded documents, scans directories, persists state, and generates output files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrase "写投标方案" is broad enough to match ordinary conversation, which can cause the skill to activate unexpectedly in contexts where the user did not intend document analysis, file operations, or state persistence. Unintended activation is security-relevant here because the skill can read uploaded files, scan saved proposal state, and write outputs, so accidental invocation may expose or process sensitive enterprise bidding materials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The template describes broad asset discovery and external attack-surface intelligence collection, including internet-exposed assets, emails, sensitive code, documents, and dark-web sources, but does not pair this with any explicit authorization, privacy, notice, or data-minimization language. In a bidding/operational template, this omission can normalize over-collection and create compliance and privacy risk when reused in real customer engagements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document proposes 7×24 website monitoring for sensitive files, user information, sensitive words, and content crawling, yet does not disclose privacy implications or define boundaries for handling personal or regulated data that may be discovered. This creates a real governance gap because operators may inspect, store, or redistribute sensitive web content without clear consent, minimization, or retention controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template calls for deploying host agents that monitor files, intrusion behavior, webshells, and may scan or remove malicious files, but it does not clearly warn about endpoint inspection, potential false positives, or operational effects on monitored systems. In practice, endpoint agents can access sensitive local data and take actions that affect availability, making the missing disclosure and control language a meaningful risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The real-time response section authorizes rapid blocking and session disruption within minutes but does not clearly warn about operational impact such as interrupting legitimate traffic, terminating valid sessions, or causing business outages through misclassification. In a reusable proposal template, this can encourage aggressive blocking without governance, approval thresholds, or fallback procedures.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file's stated purpose and embedded defaults are oriented entirely toward Chinese-language document generation, including Chinese headings, fonts, and template text, but there is no indication that users can opt into another language or locale. This can violate language/locale policy when a skill imposes a specific language by default without user choice or a clearly documented regional justification.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_integration.py (reported line 194)May include surrounding context.

python
from subprocess import run, PIPE

    # Test with inline text
    result = run(
        ['python3', 'scripts/analyze_requirements.py', QG_PROJECT_TEXT[:200], '--format', 'json'],
        capture_output=True, text=True,
        cwd=os.path.join(os.path.dirname(__file__), '..')

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_integration.py (reported line 206)May include surrounding context.

python
txt_path = f.name

    try:
        result = run(
            ['python3', 'scripts/analyze_requirements.py', txt_path, '--format', 'json'],
            capture_output=True, text=True,
            cwd=os.path.join(os.path.dirname(__file__), '..')

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_integration.py (reported line 243)May include surrounding context.

python
json.dump(chapters, f, ensure_ascii=False)

        # Run CLI
        result = run(
            ['python3', 'scripts/generate_docx.py', template_path, chapters_path, output_path],
            capture_output=True, text=True,
            cwd=os.path.join(os.path.dirname(__file__), '..')

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_integration.py (reported line 280)May include surrounding context.

python
with open(analysis_path, 'w', encoding='utf-8') as f:
            json.dump(analysis, f, ensure_ascii=False)

        result = run(
            ['python3', 'scripts/prompt_builder.py', chapter_path, analysis_path],
            capture_output=True, text=True,
            cwd=os.path.join(os.path.dirname(__file__), '..')

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This manifest file contains user-facing natural-language fields entirely in Chinese, but it does not document that the skill is intended only for Chinese-speaking users or provide any language choice. Under the policy rule for language or locale constraints, forcing a specific language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

该文件全文以中文定义章节模板,并在开头直接规定 AI 生成章节内容应参照这些模板,但没有说明是否仅适用于中文投标场景,也没有给出语言选择。按照规则,强制特定语言而无用户 opt-in 属于自然语言层面的语言/locale 策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code returns natural-language error and fallback guidance in Chinese only when python-docx is unavailable. Because the script otherwise presents English usage/help text, forcing a specific language in these user-facing responses can violate language/locale policy when no user opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The exception path includes a user-facing fallback suggestion in Chinese only. This imposes a locale choice on all users without opt-in and is inconsistent with the script's otherwise English CLI messaging.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This Python test file contains natural-language expectations exclusively in Chinese, including asserted scene labels such as '安全服务类', '产品交付类', '等保测评类', and '综合类'. Under the policy for natural-language violations, forcing a specific language without opt-in can be a locale/language policy issue when no justification or user choice is documented in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python test file is in scope for SQP-3, which applies to all file types. The sample data and later assertions are built around Chinese-language project names and expected prompt content, which can enforce a specific language/locale behavior if the underlying skill is expected to be generally applicable rather than explicitly Chinese-only.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.