Back to skill

Security audit

党政机关公文格式标准排版

Security checks for vulnerabilities and agentic risk

Overview

This is a local Chinese government-document formatting skill with clear purpose-aligned file processing, though users should confirm edits and manage unpinned Python dependencies carefully.

Install this only if you need Chinese GB/T 9704-2012 official-document workflows. Provide only the documents you want processed, confirm before accepting style-cleaning changes, and prefer a pinned or prebuilt Python environment for python-docx/pypdf. Be aware that overwriting outputs can create hidden .bak timestamp backups in the same directory.

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:58
Finding

Unpinned Third-Party Dependencies Installed from an Unverified Package Index

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:58-62; related declarations also appear in README.md:36-37 and manifest.yaml:65-70
Vulnerability Type: Supply-chain exposure through unpinned dependencies
Risk Level: Medium

Vulnerable code snippet:

bash
python -c "import docx" || pip install python-docx

The README independently instructs installation without a version or integrity constraint:

bash
pip install python-docx

The manifest declares the dependencies without version constraints:

yaml
requirements:
  python: ">=3.9"
  packages:
    - python-docx
  optional:
    - name: pypdf

Technical Analysis

The Skill instructs the Agent to install python-docx, and optionally pypdf, from the currently configured pip package index without:

  • A reviewed version pin
  • Cryptographic hashes
  • A lockfile
  • Explicit package-index validation
  • User approval immediately before installation

Consequently, the dependency resolved during execution can differ from the version reviewed during the Skill audit. If the configured package index, upstream package, DNS/proxy path, or local pip configuration is compromised, an attacker-controlled distribution could be selected.

The main scripts import docx during startup, while PDF processing imports pypdf when that feature is used. Therefore, malicious package code could execute when the installed dependency is subsequently imported. No evidence indicates that the project intentionally retrieves a malicious package; this finding concerns the absence of dependency integrity controls.

Attack Path

  1. The required dependency is absent from the Agent environment.
  2. An attacker compromises the configured package source, an upstream release, or package-resolution infrastructure.
  3. The Skill follows its installation instruction and invokes pip without a pinned version or expected hash.
  4. Pip installs the att ...[truncated 966 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every dependency to a specifically reviewed version, including optional PDF dependencies.
  2. Maintain a lockfile or requirements file containing cryptographic hashes, and install with pip install --require-hashes.
  3. Configure an explicitly trusted package index rather than relying on ambient pip configuration.
  4. Prefer a prebuilt, isolated environment whose dependencies are installed and verified before the Skill executes.
  5. Do not automatically install missing packages during normal Skill operation. Report the missing dependency and obtain explicit user or administrator approval.
  6. Regularly scan pinned dependencies for known vulnerabilities and review updates before changing pins.
  7. Apply runtime least privilege and deny outbound network access unless it is required for a separately approved operation.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims support for PDF conversion, graded .docx compliance inspection, and style purification, but the reported implementation appears narrower or absent for several of those paths. In a government-document context, this is dangerous because users may rely on the tool for formal compliance and submission readiness, while important checks or transformations never actually occur.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims support for PDF conversion, graded .docx compliance inspection, and style purification, but the reported implementation appears narrower or absent for several of those paths. In a government-document context, this is dangerous because users may rely on the tool for formal compliance and submission readiness, while important checks or transformations never actually occur.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
| 公文排版、红头文件、按国标排公文、不规范 Word/TXT 重排为公文 | **A. 排版** | `scripts/gongwen_format.py` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 90)May include surrounding context.

md
| 公文排版、红头文件、按国标排公文、不规范 Word/TXT 重排为公文 | **A. 排版** | `scripts/gongwen_format.py` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 99)May include surrounding context.

md
| 公文排版、红头文件、按国标排公文、不规范 Word/TXT 重排为公文 | **A. 排版** | `scripts/gongwen_format.py` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 118)May include surrounding context.

md
| 公文排版、红头文件、按国标排公文、不规范 Word/TXT 重排为公文 | **A. 排版** | `scripts/gongwen_format.py` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 203)May include surrounding context.

md
| 公文排版、红头文件、按国标排公文、不规范 Word/TXT 重排为公文 | **A. 排版** | `scripts/gongwen_format.py` |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The text says the skill will '严格依据《党政机关公文格式》GB/T 9704-2012' to convert drafts into formal documents, which imposes a PRC government-document standard and Chinese formatting regime by default. In this README, that locale-specific constraint is not presented as a user choice or explicitly justified as a region-specific tool boundary at the point of description, so it can violate the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill instructs the agent to execute local scripts, read user-supplied files, write output documents, and inspect the runtime environment, but it does not declare any explicit tool scope or permission boundary. That makes the effective capability surface broader than the metadata suggests, increasing the risk of over-privileged execution, unintended file access, or unsafe invocation in hosts that rely on manifest-level scoping.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

SQP-3 applies to all file types, including markdown. The description constrains operation to Chinese government-document formatting and explicitly includes converting content into official administrative written Chinese, but does not present this as a user-selectable language or locale option.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill says that if a user merely provides a text passage without explicitly requesting transformation, it should automatically run style cleaning. That exceeds the stated requirement that style normalization be user-invoked, creating a prompt-scope violation where user content is modified without clear consent and potentially altering official text inappropriately.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest is in scope for vague-trigger review. While several triggers are domain-specific, phrases such as “帮我排个版”, “去口语化”, “去 AI 味”, and “改成公务书面语” are broad natural-language requests that can arise in ordinary editing contexts and do not by themselves clearly constrain activation to this skill’s government-document workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

该参考文档从标题、参数说明到示例均仅使用中文,且未说明这是面向特定中文地区或合规场景的限定文档。按规则,若技能强制特定语言而没有用户选择或明确、合理的区域性说明,可构成语言/locale 政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire FAQ and user-directed instructions are presented only in Chinese, including normative statements about how the user should interact with the skill. There is no indication that the language requirement is optional, user-selectable, or justified as a region-specific constraint, which makes this a natural-language locale policy concern under the stated rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire checklist is written exclusively in Chinese and defines formatting rules for Chinese official documents, with no indication that users can choose another language or locale. Under the stated policy, forcing a specific language or locale without opt-in should be flagged unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The title explicitly defines the skill as a rule set for purifying official-document style in Chinese, which imposes a fixed language/locale constraint. Because the document does not offer user opt-in or clarify that the skill is limited to Chinese government-document contexts, it can be read as forcing a specific language style by default.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level documentation explicitly states the tool only scans objective format items and does not make content judgments. However, later code evaluates content-level aspects such as invalid dates, mismatch between date year and document-number year, and whether a '请示' contains expected request-closing language, which contradicts that stated intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring says it only performs '机械式格式扫描' and checks only '可机器判定' objective formatting items without judging content, but these routines go beyond formatting into document-content logic and genre conventions. Examples include validating date plausibility, comparing date year against document-number year, and checking whether a '请示' contains a conventional closing phrase, which are not purely format checks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language behavior that is explicitly tied to Chinese official-document formatting and emits Chinese-only user-facing messages. Because it forces a specific language/locale experience without any user opt-in or alternative, it matches the language/locale policy-violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring describes the tool exclusively as converting text into official Chinese administrative writing and all examples assume that output mode. This is a natural-language locale constraint presented as mandatory behavior, but the file does not offer user opt-in or describe a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file is entirely written as a fixed Chinese-language report template and does not indicate that language selection is optional or user-configurable. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The file content is entirely written in Chinese and does not provide any indication that language selection is optional or that the skill is explicitly limited to a Chinese-language or region-specific context. 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
82% confidence
Finding

The file is entirely prescriptive in Chinese and defines a fixed national-standard format for party and government documents, including required wording and typography. Because SQP-3 applies to natural-language policy violations in any file type, this can be read as forcing a specific language/locale without explicit opt-in or a clear scope statement that the skill is only for this locale-specific use case.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring explicitly states it converts Markdown / TXT / DOCX / JSON into compliant .docx documents, but the manifest description limits formatting inputs to Markdown/TXT/DOCX/PDF (text layer). This is a genuine description-behavior mismatch because JSON is an additional supported source format not disclosed in the skill description.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.