Back to skill

Security audit

word-formatter 黑灰白

Security checks for vulnerabilities and agentic risk

Overview

This Word-formatting skill appears purpose-aligned, but its install and update path pulls changing remote code and unpinned dependencies, so users should review it before installing.

Install only if you are comfortable with a Chinese-report-specific Word formatter that creates persistent files under ~/.workbuddy and runs local Python scripts on your documents. Prefer installing from a pinned reviewed commit, pin Python/npm dependency versions, avoid the optional Mermaid backend unless needed, and review generated documents before delivery.

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

Mutable Remote Sources and Unpinned Third-Party Dependencies

Content
View full analysis
/dev/null || true fi echo "✅ 更新完成!版本:$(git describe --tags --always 2>/dev/null || echo 'latest')" exit 0 fi ``` `install.sh:33-43`: ```bash git clone "$REPO_URL" "$TARGET_DIR" cd "$TARGET_DIR" # 创建 Python 虚拟环境 echo "🐍 创建 Python 虚拟环境..." python3 -m venv .venv .venv/bin/pip install --upgrade pip .venv/bin/pip install python-docx matplotlib pillow ``` `requirements.txt:1-3`: ```text python-docx>=1.1.0 matplotlib>=3.7.0 pillow>=10.0.0 ``` `SKILL.md:161-165` also instructs users to install unpinned Python and npm dependencies: ```bash .venv/bin/pip install python-docx matplotlib pillow cd ~/.workbuddy/binaries/node/workspace 2>/dev/null || mkdir -p ~/.workbuddy/binaries/node/workspace cd ~/.workbuddy/binaries/node/workspace && npm install @mermaid-js/mermaid-cli ``` ### Technical Analysis The installation and update process trusts mutable upstream state: 1. `git clone` retrieves the current state of a remote repository without pinning or verifying a reviewed tag, commit hash, checksum, or signature. 2. `git pull` automatically incorporates future upstream changes into an installed Skill. 3. Python dependencies use lower-bound constraints rather than exact versions. Any future version satisfying the constraint can be installed. 4. The installer separately installs package names without version constrai ...[truncated 2403 chars]
Remediation
View remediation
matplotlib== pillow== ``` 3. **Use hash-locked dependencies** - Generate a lock file containing hashes for every direct and transitive dependency. - Install with hash verification, for example: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. **Pin the npm dependency** - Specify an exact reviewed version of `@mermaid-js/mermaid-cli`. - Commit and enforce a lockfile. - Use `npm ci` rather than an unrestricted `npm install` in reproducible environments. 5. **Restrict package sources** - Explicitly configure trusted Python and npm registries. - Avoid unexpected fallback indexes. - Consider using an internally mirrored and reviewed package repository. 6. **Verify release integrity** - Publish checksums or signatures for Skill releases. - Validate downloaded artifacts before installation. - Record the installed Skill revision and dependency versions for auditability. 7. **Fail closed during updates** - Remove `2>/dev/null || true`. - Surface dependency installation failures and abort the update if environment synchronization fails. - Perform updates in a staging directory and replace the active installation only after all verification and installation steps succeed. 8. **Add automated supply-chain checks** - Scan locked dependencies for known vulnerabilities. - Review dependency changes before release. - Generate a software bill of materials for each published version. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码的核心用途与“Word 文档后期排版”大体一致,且确实实现了黑白灰配色约束、页面设置、表格规范、封面、页眉页脚等排版功能。但声明中两个重要卖点——“合规校验”和“图件处理/结构化图件渲染”——在代码中完全没有体现,属于实质性能力缺失。另外,描述提到 Heading 1-6,而代码只覆盖到 Heading 1-3,存在范围夸大。因此该描述不能准确代表该代码块的实际行为,应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

描述将技能定位为一个可执行专业 Word 排版、规范化、图件插入/渲染的综合后处理技能,而提供的代码块本质上是“校验器”而非“排版器”。它的主要功能是验证文档是否符合配置要求,并输出 Markdown 清单,不会写回 docx、不会统一样式、不会生成封面、不会设置页眉双栏、不会插入或渲染流程图/股权架构图/风险矩阵。因此其实际主用途与声明的核心能力存在明显偏差。虽然声明中包含“合规校验”,这部分与代码一致,但不足以覆盖描述中占主导地位的排版与图件生成能力,因此应判定为描述与行为不完全一致,属于实质性能力夸大。

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/diagrams.py (reported line 279)May include surrounding context.

python
try:
        out_dir = os.path.dirname(os.path.abspath(out_path))
        out_name = os.path.basename(out_path)
        env = dict(os.environ)
        env["PUPPETEER_SKIP_DOWNLOAD"] = "1"
        cmd = [node_bin, mmd_js, "-i", mmd_file, "-o", out_name,
               "-b", "transparent", "-t", "default"]

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The natural-language content, including title, description, and usage instructions, is presented only in Chinese, which can force a specific language on users without opt-in. The policy allows locale constraints only when the skill offers a language choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes shell commands, reads files, and depends on environment state, but it does not declare any explicit tool scope or allowed-tools boundary. That increases the chance an agent runtime grants broader-than-necessary capabilities, enabling unintended command execution or filesystem access beyond simple document formatting.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document prescribes specific Chinese typography conventions such as 宋体 and 黑体 as universal formatting rules, and the overall instructions are framed exclusively around Chinese-language report standards. This imposes a locale-specific output policy without explicit user opt-in or a documented region-specific constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill expands its attack surface by introducing Mermaid rendering via npm/mermaid-cli/Chromium, which brings in a large external toolchain unrelated to core python-docx formatting. Extra binaries and package installation steps increase supply-chain and command-execution risk, especially if diagram content is later rendered through a browser-backed CLI.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The setup instructions create persistent state under the user's home directory and install Node packages into a reusable workspace. Persistent environments can retain unreviewed dependencies, stale binaries, or modified state across sessions, making later executions less predictable and potentially exposing users to supply-chain or tampering risks.

Content

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

.venv/bin/pip install python-docx matplotlib pillow

Mermaid 可选后端(仅在使用 engine=mermaid 时需要)

cd ~/.workbuddy/binaries/node/workspace 2>/dev/null || mkdir -p ~/.workbuddy/binaries/node/workspace cd ~/.workbuddy/binaries/node/workspace && npm install @mermaid-js/mermaid-cli

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest hard-codes a Chinese financial due-diligence report type and a China-specific regulatory standard, and the rest of the file consistently requires Chinese headings and Chinese fonts. Because there is no opt-in, alternative locale, or documented scope limitation indicating the skill is intentionally region-specific only, the file imposes a specific language/locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON manifest embeds a Chinese-only report template and locale-specific typography, including Chinese fonts and Chinese text throughout the document structure. Because the file provides no user opt-in or alternative locale selection, it effectively forces a specific language/locale, which matches the 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 document type and standard are defined exclusively for Chinese-language financial reports, and multiple fields throughout the file prescribe Chinese content and formatting conventions. Because the configuration does not indicate that this locale is optional or user-selected, it appears to force a specific language/locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON manifest includes natural-language requirements and document metadata entirely in Chinese, with mandatory Chinese font selections such as 宋体 and 黑体 and Chinese-only document structure labels. Because the file does not state that the skill is limited to a China-specific or Chinese-language use case, it appears to force a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrase "排版" is extremely broad and can match many ordinary user requests about formatting, causing the skill to activate outside its intended niche of consulting-report .docx post-processing. Over-broad activation increases the chance of unintended routing, where user content is processed by a specialized skill without clear consent or fit, which can lead to incorrect transformations or unexpected handling of sensitive business documents.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Several trigger phrases such as "规范排版", "格式校验", and "插入图件" are still broad enough to overlap with common document-editing requests outside the stated five report types. In a document-processing skill, ambiguous triggers can cause over-invocation on unrelated files or contexts, increasing the risk of unauthorized or inappropriate content modification in user documents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains natural-language requirements tied exclusively to Chinese document standards and punctuation conventions, such as GB/T formatting rules for formal Chinese documents. Because the skill reference does not indicate that the language/locale restriction is optional or limited to a clearly region-specific compliance context, it appears to force a specific locale without user opt-in.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest frames this skill as a python-docx configuration-driven Word formatting and diagram-processing capability, but this path depends on executing an external Node-based renderer via subprocess. Spawning external binaries is not an obvious requirement for Word post-formatting and introduces a capability outside the core local document-manipulation context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/diagrams.py (reported line 284)May include surrounding context.

python
cmd = [node_bin, mmd_js, "-i", mmd_file, "-o", out_name,
               "-b", "transparent", "-t", "default"]
        # mmdc 在工作目录输出
        subprocess.run(cmd, cwd=out_dir, env=env, check=True,
                       stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    finally:
        os.unlink(mmd_file)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring specifies Chinese report formatting conventions throughout, including Chinese page-number text and GB/T 9704 public-document formatting, as if they are universal defaults. This is a natural-language locale policy issue because the file presents a fixed language/locale behavior without offering a user choice or clearly limiting the tool to a China-specific compliance context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module documentation states that only black/white/gray are allowed and that colored emphasis is prohibited. However, set_run_font explicitly preserves an author's existing RGB color unless enforce_color is true, and the docstring comment even mentions retaining deep blue/deep red emphasis colors; body paragraphs call this through fix_paragraph_direct with configurable enforce_color, so the documented absolute prohibition is contradicted by the implementation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The header/footer configuration comments define Chinese output conventions such as “第 N 页 共 M 页” and GB/T 9704 formatting, and elsewhere the cover-page text includes fixed Chinese labels like “委托方:”. Because these conventions are embedded as the expected behavior rather than presented as an optional locale, they constitute a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The markdown includes shell commands that write to the user's filesystem under ~/.workbuddy/skills, create a virtual environment, and install packages, but it does not include any warning or disclosure about these environment-changing actions. For markdown files, user-facing documentation should warn about behaviors that may affect system integrity or local data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill description states it will perform post-processing and formatting on user-provided Word documents, which is a user-data-affecting operation. While later notes mention some caveats, the description lacks a clear initial warning that the skill will materially rewrite document formatting and may require user review afterward.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON template specifies the document's design language, document type, standard, and structure entirely in Chinese, indicating a fixed language/locale behavior. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.