Back to skill

Security audit

wps

Security checks for vulnerabilities and agentic risk

Overview

This WPS Office skill is a disclosed Chinese office-document workflow helper with local document conversion, generation, inspection, and spreadsheet cleanup scripts.

Install this if you want a Chinese-focused WPS/Office document workflow helper and are comfortable running local scripts on documents you choose. Use a virtual environment for python-docx/openpyxl, prefer pinned dependencies where possible, and review files before conversion or cleanup when they contain sensitive business or personal data.

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

Note
Location
scripts/docx_gen.py:156
Finding
Unpinned Third-Party Python Dependency Installation Instructions## Vulnerability Details **File Locations**: - `scripts/docx_gen.py:156-158` - `scripts/xlsx_tool.py:161-163` - `scripts/inspect_doc.py:132-134` **Vulnerability Type**: Unpinned and unverifiable third-party dependencies **Risk Level**: Low ### Vulnerable Code `scripts/docx_gen.py:156-158` ```python if not _DOCX_OK: print("[Error] Missing third-party library python-docx; install it first:") print(" pip install python-docx") ``` `scripts/xlsx_tool.py:161-163` ```python if not _OPENPYXL_OK: print("[Error] Missing third-party library openpyxl; install it first:") print(" pip install openpyxl") ``` `scripts/inspect_doc.py:132-134` ```python if not _DOCX_OK: print("[Error] Missing third-party library python-docx; install it first:") print(" pip install python-docx") ``` ### Technical Analysis The scripts instruct users to install `python-docx` and `openpyxl` without specifying reviewed versions, package hashes, an authenticated package source, or a dependency lock file. Consequently, pip resolves mutable package releases from whatever index is configured in the user's environment. The package names are legitimate and there is no evidence that this project intentionally introduces a malicious dependency. The scripts also do not perform installation automatically. Nevertheless, the instructions create a supply-chain trust boundary that is neither reproducible nor cryptographically verified. A compromised upstream release, package repository, dependency of either package, or attacker-controlled pip mirror could supply malicious package content. Python package installation and subsequent import can execute package-controlled code with the privileges of the invoking user. ### Attack Path 1. A user invokes one of the scripts in an environment where the required package is unavailable. 2. The script displays an instruction to run an unpinned `pip install` command. 3. The user executes that command. 4. Pip resolves the c ...[truncated 1275 chars]
Remediation
## Remediation Suggestions 1. Create a reviewed dependency file that pins exact versions: ```text python-docx==REVIEWED_VERSION openpyxl==REVIEWED_VERSION ``` 2. Generate and verify SHA-256 hashes for every direct and transitive dependency, then require hash validation during installation: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Use a lock-file workflow, such as `pip-tools`, to produce deterministic transitive dependency versions. 4. Update runtime guidance to direct users to the reviewed dependency file rather than installing unconstrained package names: ```python print("Install the reviewed dependencies with:") print(" python -m pip install --require-hashes -r requirements.txt") ``` 5. Recommend installation in a dedicated virtual environment with ordinary user privileges. Do not recommend administrator or root installation. 6. Document the expected package index and advise users to verify pip configuration before installation. In controlled deployments, use an authenticated internal mirror containing reviewed artifacts. 7. Add automated dependency scanning and periodic review of pinned versions so security updates can be adopted without reverting to unconstrained installations.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description presents a broad WPS Office assistance skill for many end-user tasks across Writer/Spreadsheets/Presentation, including editing, review, troubleshooting, collaboration, compatibility, and migration guidance. The supplied code is much narrower: it is a standalone command-line converter that calls local LibreOffice/soffice to convert files to PDF or OOXML formats in batch. While conversion/export overlaps partially with the description, the primary purpose and implementation are materially different. The code does not implement most of the declared WPS-centric capabilities, and its actual behavior is specifically local batch conversion via LibreOffice subprocess execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description presents a comprehensive WPS Office assistant for multiple app types and tasks, especially user guidance around document handling, compatibility, review features, export, and migration. The supplied code instead implements a narrow file-conversion utility: it parses a small subset of Markdown and writes a formatted .docx file. While the generated .docx may be usable in Word/WPS and the code mentions Word/WPS font rendering, that is only incidental compatibility, not a full WPS workflow capability. The primary purpose and supported capabilities are materially narrower and different from the description, so this is a clear mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description presents a general-purpose WPS Office assistance skill spanning multiple applications and file types, with user-facing guidance on editing, compatibility, PDF export, collaboration, and migration. The supplied code instead implements a narrow local inspection tool for .docx files only. It parses WordprocessingML XML inside the DOCX ZIP package to count fonts, page breaks, section breaks, comments, and tracked changes, and outputs a delivery-readiness conclusion. This is materially different in primary purpose and scope from the declared WPS workflow assistant. While comments/revisions and document handling are loosely related to office documents, the code neither provides the broad WPS support described nor handles spreadsheets, presentations, conversion, PDF export, or troubleshooting workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description presents a broad WPS Office assistance capability spanning multiple app types and common end-user workflows. The supplied code instead is a narrow technical script for .xlsx files only, using openpyxl to deduplicate worksheet rows and inspect workbook properties. Its primary purpose is spreadsheet cleaning and pre-delivery checking, not general WPS document assistance, document conversion, collaboration, review features, or cross-format troubleshooting. While there is partial thematic overlap with spreadsheets and Chinese-language office usage, the actual behavior is materially narrower and different, and it adds a specific undeclared capability (dedup/check automation for .xlsx via CLI).

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises and references local scripts plus binary execution requirements, which implies shell, file read/write, and environment access, but it declares no explicit tool scope or permissions boundary. That makes the operational trust boundary unclear and can allow broader-than-expected execution in hosts that rely on manifest-declared permissions for isolation and review.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The manifest description explicitly says the skill is for Chinese users and provides Chinese trigger terms, which creates a language/locale constraint in the activation text. The file does not indicate that users can choose another language or opt into this locale-specific behavior.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
f,
        ]
        try:
            result = subprocess.run(
                cmd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This Python file contains natural-language descriptions specifying Chinese typesetting conventions and Chinese fonts as the intended output format. Under the policy rule, forcing a specific language/locale without opt-in can be a violation when no user choice or justification is provided.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The heading explicitly scopes formatting guidance to Chinese documents only, and the document overall is written entirely in Chinese without indicating that other languages or locales are supported. Under the stated policy, forcing a specific language or locale without opt-in is a natural-language policy concern.

Static analysis

No suspicious patterns detected.