Back to skill

Security audit

微信公众号排版

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it may send article drafts through an unspecified third-party online editor and installs unpinned dependencies.

Install only if you are comfortable with drafts being processed through mdnice's online editor. Do not use it for confidential, regulated, credential-containing, or unpublished business material unless you first verify the exact network destinations and trust the service. Prefer a sandboxed environment and pinned dependency versions.

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 (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:20
Finding

Unpinned Third-Party Dependencies Create a Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:20-23; also documented in scripts/convert.py:8-10
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code

bash
pip install mdnice requests
playwright install chromium

The same installation requirements are repeated in the script:

python
Dependencies:
    pip install mdnice requests
    playwright install chromium

Technical Analysis

The installation instructions do not pin exact versions of mdnice, requests, or Playwright's Chromium distribution. The project also provides no dependency lock file, package hashes, integrity verification, or documented set of tested versions.

Consequently, the code installed when the Skill is used can differ from the code that existed when the Skill was audited. Python packages can execute code during installation and at runtime. A compromised package release, dependency account, package index, or transitive dependency could therefore introduce arbitrary behavior without requiring any change to this repository.

The Skill directly uses mdnice, while requests is not directly imported by the provided script. Installing packages that are not demonstrably needed increases the supply-chain attack surface.

Attack Path

  1. An attacker compromises a listed package, one of its transitive dependencies, or its package-distribution account.
  2. The attacker publishes a malicious package version that still satisfies the unbounded installation command.
  3. An Agent or user follows the Skill instructions and runs pip install mdnice requests or installs the latest Playwright Chromium distribution.
  4. The malicious package executes installation hooks or malicious runtime code.
  5. The payload operates with the permissions of the account running the installation or conversion.

Impact Assessment

Successful exploitation could allow arbitrary code execution under th ...[truncated 450 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an exact, reviewed version.
  2. Add a lock file containing all transitive dependencies.
  3. Require package hashes, for example by using pip install --require-hashes -r requirements.txt.
  4. Pin and document the tested Playwright and Chromium versions.
  5. Install packages only from explicitly trusted indexes and disable unintended extra indexes.
  6. Remove requests from the installation instructions unless it is a verified runtime dependency.
  7. Run installation and conversion in a sandboxed environment with minimal filesystem and network permissions.
  8. Add automated dependency vulnerability and integrity scanning to the release process.

other

Warning
Location
SKILL.md:69
Finding

User Markdown Is Processed Through Unspecified External Online Services

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:69-70; external conversion is invoked at scripts/convert.py:50-64
Vulnerability Type: other: External Data Disclosure
Risk Level: Medium

Vulnerable Code

The documentation confirms that conversion relies on external online editors:

markdown
- The conversion uses Playwright in headless mode to render the markdown in mdnice's online editor, then extracts the styled HTML via CDP
- This relies on external mdnice editor URLs (default + fallback). If both are unreachable, conversion will fail — check network connectivity

The script delegates the Markdown document to the external conversion implementation:

python
converter = MarkdownConverter(
    headless=True,
    code_theme=code_theme,
    mac_style=mac_style,
    clean_html=True,
)

result = converter.convert(
    str(md_path),
    theme=theme,
    platform="wechat",
    output_dir=output_dir,
    return_html=False,
    wrap_full_html=False,
)

Technical Analysis

The Skill is presented as a Markdown-to-HTML formatter, but its implementation depends on loading an external mdnice online editor in a headless browser. The documentation does not identify the destination domains, enumerate the document content or metadata sent to those destinations, describe their retention policies, or require explicit user consent before processing.

The network behavior is delegated to the mdnice dependency. Because that dependency is also unpinned, its external destinations and data-handling behavior can change independently of this repository.

User Markdown can contain confidential drafts, unpublished business information, personal information, embedded URLs, or references to local resources. Processing such input through third-party infrastructure creates a confidentiality risk that would not exist in a fully local formatter.

Attack Path

  1. A user supplies a private or ...[truncated 1111 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prefer a fully local rendering mode that does not transmit document content to an online editor.
  2. If external processing is unavoidable, disclose the exact destination domains and the categories of data transmitted.
  3. Obtain explicit user consent before initiating any external conversion.
  4. Warn users not to process confidential, regulated, or unpublished material through the online mode.
  5. Enforce a strict network allowlist and block redirects or requests to undeclared destinations.
  6. Pin and review the mdnice implementation so its network behavior cannot change silently.
  7. Document the external service's retention, privacy, and deletion policies.
  8. Add a preview or dry-run mode that reports intended network destinations without uploading or rendering the document.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no explicit tool or permission scope even though its documented workflow requires file reads, file writes, package installation, and network access. Missing scope boundaries increases the chance that an agent will execute the skill with broader capabilities than necessary, reducing reviewability and enabling unintended data access or outbound communication.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill routes markdown through external mdnice editor URLs using Playwright, which introduces outbound network transfer into a formatter workflow. Because article content may include unpublished drafts, credentials, internal links, or sensitive business text, this external dependency creates a confidentiality and supply-chain risk beyond what users may expect from local formatting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation says the conversion relies on external mdnice editor URLs but does not clearly warn that the user's markdown content may be transmitted to a third-party service. This creates a transparency and privacy failure: users may unknowingly expose unpublished or sensitive content to an external service during a seemingly local formatting task.

Content

No source excerpt is available for this finding.

Tainted flow: 'content' from pathlib.Path.read_text (line 103, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/convert.py (reported line 104)May include surrounding context.

python
content = path.read_text(encoding="utf-8")
    for old, new in replacements:
        content = content.replace(old, new)
    path.write_text(content, encoding="utf-8")

    print(f"🔤 字体已优化: {path.name}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing output in Chinese (for example the status message at L106), and the available theme names and related text are also Chinese-facing. The skill does not offer any user opt-in or alternative locale, which can violate language/locale policy for general-purpose tools.

Content

No source excerpt is available for this finding.