Back to skill

Security audit

DOCX Formatter

Security checks for vulnerabilities and agentic risk

Overview

This skill is a narrow local tool for generating Chinese official-format Word documents, with no evidence of hidden data access or destructive behavior.

Install this only if you want Chinese official-document formatting. Prefer explicit invocation for specific .docx formatting tasks, and consider pinning python-docx or installing in an isolated environment before use.

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
install.sh:16
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `install.sh`, line 16 **Vulnerability Type**: Supply-chain risk caused by an unpinned dependency **Risk Level**: Medium ### Vulnerable Code ```bash uv pip install python-docx ``` ### Technical Analysis The installation script retrieves `python-docx` without specifying an audited version or verifying a cryptographic hash. Consequently, the installed artifact depends on mutable package-index state and local package-index configuration at installation time. This does not prove that the current `python-docx` package is malicious. However, it creates a supply-chain exposure: a compromised package release, package index, mirror, or index configuration could provide attacker-controlled package content. Package installation may execute build backend or installation-related code with the privileges of the user running `install.sh`. ### Attack Path 1. An attacker compromises the configured Python package index, mirror, relevant package release, or dependency-resolution configuration. 2. The victim runs `./install.sh`. 3. Line 16 asks `uv` to resolve the latest acceptable `python-docx` distribution from the configured source. 4. `uv` downloads and installs the attacker-controlled distribution into `.venv`. 5. Malicious build or installation behavior executes with the installing user's privileges, or malicious runtime code is placed in the virtual environment for later execution. ### Impact Assessment Successful exploitation could execute arbitrary code under the account that runs the installer. This may permit access to that user's readable files, modification of files writable by that user, theft of accessible credentials, and tampering with generated documents or the local virtual environment. The script does not request elevated privileges, so the direct impact is normally limited to the installing user's permissions. System-wide compromise would require the installer to be run by a privileged account or an addition ...[truncated 38 chars]
Remediation
## Remediation Suggestions 1. Pin `python-docx` and all transitive dependencies to reviewed versions. 2. Generate and commit a lockfile containing cryptographic hashes. 3. Require hash verification during installation and reject artifacts whose hashes are absent or mismatched. 4. Explicitly configure an approved HTTPS package index rather than relying on mutable user or environment configuration. 5. Review and update locked dependencies through a controlled process with vulnerability and provenance checks. 6. Run installation as an unprivileged user in an isolated virtual environment. For example, use a fully locked requirements file: ```bash uv pip install --require-hashes -r requirements.lock ``` The lockfile should contain exact versions and SHA-256 hashes for every resolved distribution.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (7)

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The skill states that it will 'strictly' generate documents according to Chinese official document standards, without indicating that this is optional or user-selectable. In practice, this can improperly constrain outputs for users who want a different locale, institution, or neutral formatting style, leading to misformatted or context-inappropriate documents.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The skill advertises automatic triggering for very broad keywords such as '报告', '总结', '方案', '修改', and 'Word', which can match many ordinary writing requests outside the narrow scope of Chinese government-document formatting. This can cause the agent to invoke the skill in unintended contexts, overriding user intent or steering output toward official-document workflows and installation/execution paths the user did not explicitly request.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The module docstring states it 'strictly' generates documents according to Chinese official-document formatting standards, which imposes a specific locale and formatting regime. The file also hardcodes Chinese typography and fonts throughout, with no indication that users can choose another language or locale.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The text explicitly requires use of Chinese quotation marks and states that this conforms to official document formatting norms, which imposes a specific language/locale convention. The file does not indicate that users may choose another language or locale, nor does it explain a justified region-specific constraint.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The module docstring and the embedded example content are entirely framed as a Chinese public-document generator, which imposes a specific language/locale expectation. The file does not indicate that language is optional, user-selectable, or justified as a region-specific compliance requirement, so this is a natural-language locale policy concern.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
This shell script presents all user-facing messages and usage text in Chinese, including installation progress and invocation guidance. Because the file provides no language selection, opt-in, or justification that the skill is region-specific, it conflicts with the policy against forcing a specific language without user choice.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The script's comments and user-facing messages are entirely in Chinese, including status output shown to the user. For a general-purpose skill file, this imposes a specific language without user opt-in, which matches the locale policy violation criteria.

Static analysis

No suspicious patterns detected.