Back to skill

Security audit

official Document Template

Security checks for vulnerabilities and agentic risk

Overview

This skill is a narrow Chinese official-document formatter; its main risk is ordinary unpinned Python dependency guidance, not hidden or malicious behavior.

Install this if you specifically need Chinese GB/T 9704-2012 official-document formatting. Use a virtual environment and consider pinning `python-docx` before installation; generated documents may still need manual review in Word or WPS for fonts and final layout.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:105
Finding

Unpinned and Unverified Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 105–109
Vulnerability Type: Unpinned third-party dependency and insufficient supply-chain verification
Risk Level: Medium

Complete Code Snippet

markdown
## 依赖

```bash
pip install python-docx
```

The installed package is subsequently imported by scripts/convert_to_docx.py:

python
try:
    from docx import Document
    from docx.shared import Pt, Cm, Twips
    from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_LINE_SPACING
    from docx.enum.style import WD_STYLE_TYPE
    from docx.oxml.ns import qn
    from docx.oxml import OxmlElement
except ImportError:
    print("需要安装python-docx: pip install python-docx")
    sys.exit(1)

Technical Analysis

The installation command does not pin python-docx to a reviewed version, verify package hashes, use a lockfile, or explicitly select a trusted package index. Its resolved package contents can therefore change independently of the audited Skill.

The exact exploitation scenario depends on the user's pip configuration and the security of the selected package repository. If an attacker compromises a future package release, a transitive dependency, or a configured package index, attacker-controlled code may run during package installation, package build steps, or subsequent import by the converter.

This is a supply-chain hardening deficiency. The audit found no evidence that the project intentionally retrieves a malicious package, and python-docx is not a typographical imitation in the reviewed instruction.

Attack Path

  1. A user follows the dependency installation command in SKILL.md.
  2. Pip resolves the unpinned package from the user's configured package index.
  3. An attacker compromises or substitutes the resolved package, one of its dependencies, or the configured index response.
  4. The compromised component is downloaded and installed without hash verification.
  5. Malicious installation or build logic executes, ...[truncated 797 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin python-docx and all transitive dependencies to reviewed versions in a committed requirements or lock file.
  2. Record cryptographic hashes and require pip to verify them:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Explicitly use an approved package index rather than inheriting an unknown local index configuration:
    bash
    python3 -m pip install \
      --index-url https://pypi.org/simple \
      --require-hashes \
      -r requirements.txt
    
  4. Install dependencies inside an isolated virtual environment using an unprivileged account.
  5. Review and update pinned dependencies through a controlled process that includes vulnerability scanning, provenance verification, and regression testing.
  6. Remove or synchronize the duplicate unpinned installation guidance in the script's ImportError message so users are consistently directed to the verified requirements file.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description and title describe the skill exclusively as a Chinese official-document formatter for GB/T 9704-2012, which implies a fixed Chinese document standard and locale-specific formatting behavior. The file does not state that this is a China-specific skill or offer users a language/locale choice, so it can violate the language/locale policy criteria for natural-language constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring states the script is specifically for converting content into documents compliant with the Chinese GB/T 9704-2012 standard, and the implementation hard-codes Chinese fonts and formatting throughout. This is a locale-specific constraint presented as the only behavior, with no opt-in or alternative language/locale handling documented in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction mandates producing official documents according to a Chinese national standard and the entire skill is written as a prescriptive Chinese-only formatting guide. There is no indication that the user may choose another language or locale, and no explicit justification that the skill is intended only for a China-specific compliance context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

该 Markdown 文档从标题、内容到模板规范均限定为中文公文排版,并引用特定中文字体与格式要求,但没有说明这是面向特定中文/中国公文场景的区域性工具,亦未提供语言或 locale 选择。根据规则,若技能强制特定语言或 locale 且无用户 opt-in,属于自然语言政策层面的潜在违规。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.