Back to skill

Security audit

Docx Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local Word-document extraction toolkit with some documentation and safety caveats, but no evidence of hidden execution, exfiltration, persistence, or deceptive behavior.

Install in a virtual environment, consider pinning dependency versions, and run the tools only on documents you intend to process. Use explicit output directories, especially for image resizing, because omitting the resize output directory can overwrite originals and lossy compression may change image quality or format.

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

Unpinned Third-Party Dependencies Create a Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:47-48
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code:

bash
Install:
pip3 install python-docx olefile Pillow

Technical Analysis

The documented installation command installs three third-party packages without exact version constraints, integrity hashes, or a lockfile. Consequently, the code installed in the future may differ from the dependencies that existed when this Skill was audited.

Python package installation may execute package-controlled build or installation logic. In addition, imported package code executes when the Skill scripts run. If a named package, configured package index, or dependency in the transitive dependency graph is compromised, an attacker could supply malicious code without modifying this repository.

No malicious dependency, unsafe package source, or active compromise was identified during this audit. The finding concerns the absence of dependency provenance and integrity controls.

Attack Path

  1. An attacker compromises a named dependency, one of its transitive dependencies, or the Python package index configured in the target environment.
  2. The attacker publishes a malicious release that remains compatible with the unconstrained package names.
  3. A user follows the installation instructions and runs pip3 install python-docx olefile Pillow.
  4. pip resolves and downloads the attacker-controlled package version.
  5. Malicious code executes during package installation or when one of the scripts imports the compromised package.
  6. The payload operates with the privileges of the user running pip or the document-processing script.

Impact Assessment

Successful exploitation could permit arbitrary code execution under the installing or executing user's account. Depending on that account's privileges, the attacker could read or alter accessible documents, extract credent ...[truncated 346 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the unconstrained installation command with a reviewed dependency manifest containing exact versions.
  2. Generate and verify cryptographic hashes for all direct and transitive packages, then install with:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Use a lockfile-producing dependency-management tool to make transitive resolution reproducible.
  4. Download dependencies only from an explicitly trusted package index or an internally controlled artifact repository.
  5. Install dependencies inside a dedicated virtual environment and avoid running pip as root or with administrator privileges.
  6. Periodically scan pinned dependencies for known vulnerabilities and update them through a controlled review process.
  7. Consider using prebuilt, signed, and internally verified artifacts where stronger supply-chain assurance is required.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description substantially overstates the implemented functionality. The provided script is narrowly focused on extracting text from legacy .doc files via olefile. It does not process .docx files, does not extract tables or images, and contains no logic for image deduplication/filtering. Its decoding and cleanup are generic and do not demonstrate the claimed advanced support for CJK text, large documents, or complex table structures. This is a material description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad document extraction skill for .docx and .doc files covering text, tables, and images. The supplied code is narrowly focused on image extraction from .docx ZIP contents using python-docx and zipfile. It includes deduplication and filtering for images, which partially aligns with the description, and it does process CJK keywords in classification heuristics. However, there is no implementation for text extraction as an output feature, no table extraction, and no support for legacy binary .doc files. Additionally, the code performs an undeclared capability: generating contextual metadata and classifying/prioritizing images (e.g., certificate, contract, report) from surrounding paragraph text. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description significantly overstates the implemented functionality. The code only supports .docx via python-docx, not legacy .doc files. It extracts paragraph text and table cell text, but does not extract images at all, so the claimed image deduplication/filtering is absent. It also shows no specific logic for large-document handling, CJK-specific processing, or sophisticated treatment of complex table structures beyond simple row/cell iteration. The primary purpose partially overlaps (text and table extraction from .docx), but several major advertised capabilities are not implemented, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose is document content extraction from Word files, but the actual code only resizes and recompresses existing image files in a directory using Pillow. It has no logic for opening .doc/.docx files, parsing text or tables, handling CJK text, deduplicating extracted images, or filtering document-extracted assets. Its primary purpose is materially different and introduces undeclared file transformation behavior.

Content

No source excerpt is available for this finding.

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
91% confidence
Finding

Section detection and image classification rely on Chinese-specific headings and keywords, which imposes a locale-specific behavior by default. There is no opt-in, configuration, or documentation indicating that the tool is intended only for Chinese-language documents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code writes extracted images from a user-supplied .docx to the output directory, and when context is enabled it also persists surrounding paragraph text in a JSON manifest. The file header describes the feature set but does not warn that potentially sensitive document content, including certificates, contracts, or credential-related context, will be saved to disk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a toolkit that extracts text, tables, and images from both .docx and legacy .doc files, with image deduplication/filtering support. This script only opens .docx via python-docx, extracts paragraphs and tables, and has no code for images, deduplication, filtering, or legacy .doc handling, creating a clear description-to-code mismatch for this skill file.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill manifest says this skill extracts text, tables, and images from .docx and .doc files, but this file implements a standalone utility to resize and recompress generic image files for vision-token reduction. That image-processing workflow is not an obvious implementation detail of document extraction and introduces behavior outside the described scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Defaulting to in-place overwrite makes the script destructively modify user-supplied images without a strong safety prompt or backup behavior. In the context of a document-extraction skill that may process valuable evidence or source documents, this can cause irreversible data loss, quality degradation, and silent format conversion from PNG to JPEG.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language content in the description and trigger phrases is entirely Chinese, which may effectively impose a language-specific interaction model without user opt-in. The file does not state that the skill is intentionally region-specific or provide an alternative language option.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad, generic document-processing terms such as '提取文档', 'Word文档', and '提取表格', which can cause the skill to activate for many unrelated or ambiguous user requests. In an agent ecosystem, overbroad activation can route sensitive or unintended documents into this skill, increasing the chance of data exposure, incorrect tool use, or user-confusing behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module documentation says it resizes images to reduce token consumption and describes resizing behavior, but does not mention format conversion or lossy recompression. In code, non-transparent PNGs are converted to JPEG at L50-L52, which materially changes file format and content characteristics beyond simple resizing.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.