Back to skill

Security audit

wxgzh-mcp

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its WeChat account-management purpose, but it exposes live account tokens and can upload arbitrary local files, so users should review it before installing.

Install only in an isolated environment with a dedicated WeChat account, least-privilege credentials, and a restricted upload directory. Avoid using the token tool, do not print tokens into logs or transcripts, and require explicit human confirmation before deleting or publishing drafts. Pin dependencies before deployment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
src/tools/token.py:9
Finding

Live WeChat Bearer Token Exposed Through an MCP Tool

Content
View full analysis
dict: """Get WeChat Access Token. Access token is required for all other API calls. It is automatically cached and refreshed when expired. Args: force_refresh: Force refresh token even if current one is valid. Returns: dict: Contains access_token and expires_in seconds. """ api = get_api() token = api.get_access_token(force_refresh=force_refresh) return { "access_token": token, "expires_in": 7200, "message": "Token retrieved successfully. Valid for 2 hours.", } ``` The documentation also instructs users to print the complete token at `SKILL.md:72`: ```bash python -c "from src.wechat_api import WeChatAPI; api = WeChatAPI(); print(api.get_access_token())" ``` ### Technical Analysis The `get_access_token` MCP tool returns a live WeChat bearer token directly to its caller. This exceeds the minimum privileges required by the Skill because all other tools obtain and cache the token internally through `get_api()` and do not require callers to possess it. Returning the credential through MCP can place it in model context, conversation transcripts, client telemetry, tool-call logs, debugging output, or other storage outside the credential boundary. The instruction in `SKILL.md` further increases exposure by printing the complete token to standard output. The token is valid for approximately two hours and grants the bearer the WeChat API permissions associated with the configured Official Account. ### Attack Path 1. An MCP client, Agent, or user invokes `get_access_token`. 2. The Skill retrieves the account token using the configured AppID and AppSecret. 3. The complete bearer token is returned in the MCP response ...[truncated 802 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/tools/media.py:10
Finding

Unrestricted Local File Read and Upload Through Media Tools

Content
View full analysis
dict: """Upload cover/thumbnail image to WeChat Official Account. The returned media_id must be used when creating a draft. Args: thumb_path: Local path to the thumb image file (JPG/PNG, max 2MB). Returns: dict: Contains media_id of uploaded thumb cover image. """ api = get_api() media_id = api.upload_thumb(thumb_path) return { "media_id": media_id, "message": "Thumb uploaded successfully. Use this media_id in create_draft.", } @mcp.tool() def upload_image(image_path: str) -> dict: """Upload image to WeChat Official Account (for article content). This is used for images embedded in article body, not cover images. Args: image_path: Local path to the image file (JPG/PNG, max 2MB). Returns: dict: Contains media_id and url of uploaded image. """ api = get_api() result = api.upload_image(image_path) return { "media_id": result.get("media_id"), "url": result.get("url"), "message": "Image uploaded successfully.", } ``` The API client opens and uploads those paths directly: ```python def upload_image(self, image_path: str) -> Dict[str, Any]: """Upload image to WeChat server (for article content). Args: image_path: Local path to the image file. Returns: Dict with media_id and url. """ token = self.get_access_token() url = f"{self.BASE_URL}/media/uploadimg" params = {"access_token": token, "type": "image"} with open(image_path, "rb") as f: files = {"media": (image_path ...[truncated 3439 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Non-Reproducible Installation Due to Unbounded Dependency Constraints

Content
View full analysis
=0.1.0 requests>=2.28.0 ``` The documented installation command in `README.md:65-68` and `SKILL.md:67-70` installs these constraints directly: ```bash pip install -r requirements.txt ``` ### Technical Analysis Both dependencies use lower-bound-only version constraints. A fresh installation can therefore resolve to any future release accepted by the package resolver. The resulting environment is not reproducible and may change without any modification to this project. No evidence of dependency confusion, typosquatting, or a currently malicious package was found. The confirmed issue is that the installation process does not constrain dependencies to reviewed artifacts. This creates a supply-chain exposure if a future release or transitive dependency is compromised, malicious, or incompatible. Python package installation can execute package build logic, and installed dependencies subsequently run with the same access as the Skill, including access to its configuration and network operations. ### Attack Path 1. A newer version of a listed package or one of its transitive dependencies becomes compromised or otherwise unsafe. 2. A user follows the documented `pip install -r requirements.txt` command. 3. The resolver selects the newer release because the requirement has no upper bound or exact pin. 4. Package installation or import executes the selected dependency code in the Skill environment. 5. That code receives the operating-system privileges of the Skill process and may access locally available credentials, files, and network resources. ### Impact Assessment A compromised dependency could execute code during installation or runtime with the Skill process's privileges. This could expose the WeChat AppSecret, bearer tokens, draft content, mounted files, or ne ...[truncated 201 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (25)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 7)May include surrounding context.

md
## 功能特性

- ✅ 获取 Access Token(自动缓存)
- ✅ 上传封面图获取 media_id
- ✅ 上传正文图片
- ✅ 创建草稿文章

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 功能特性

- ✅ 获取 Access Token(自动缓存)
- ✅ 上传封面图获取 media_id
- ✅ 上传正文图片
- ✅ 创建草稿文章

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 功能特性

- ✅ 获取 Access Token(自动缓存)
- ✅ 上传封面图获取 media_id
- ✅ 上传正文图片
- ✅ 创建草稿文章

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The SKILL.md claims substantial capabilities around WeChat draft management, credential use, and publication, but the analyzed file only provides descriptive metadata and usage text with no verifiable implementation. This mismatch is dangerous because users or orchestrators may trust the declared behavior and authorize sensitive credentials or actions without being able to validate what the skill actually does.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
81% confidence
Finding

The phrase itself is not dangerous, but in this file it corresponds to a tool whose purpose is credential access and disclosure. In context, the skill is not merely documenting tokens; it provides a callable endpoint that returns the bearer token, making this a real credential exposure concern rather than a text-only mention.

Content

Scanner excerpt · src/tools/token.py (reported line 11)May include surrounding context.

python
@mcp.tool()
def get_access_token(force_refresh: bool = False) -> dict:
    """Get WeChat Access Token.

    Access token is required for all other API calls.
    It is automatically cached and refreshed when expired.

Credential Access

High
Category
Privilege Escalation
Confidence
78% confidence
Finding

Although this finding is triggered by documentation text, the surrounding implementation confirms that the tool operationalizes credential access by returning the token. In the context of an MCP skill, that makes the credential-access pattern meaningful and risky because other agents or users can invoke it and obtain reusable API credentials.

Content

Scanner excerpt · src/tools/token.py (reported line 13)May include surrounding context.

python
def get_access_token(force_refresh: bool = False) -> dict:
    """Get WeChat Access Token.

    Access token is required for all other API calls.
    It is automatically cached and refreshed when expired.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/wechat_api.py (reported line 20)May include surrounding context.

python
"""WeChat Official Account API client.

    Supports:
    - Access token management (auto-cached)
    - Image/thumb upload
    - Draft management
    - Material listing

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/wechat_api.py (reported line 115)May include surrounding context.

python
"""WeChat Official Account API client.

    Supports:
    - Access token management (auto-cached)
    - Image/thumb upload
    - Draft management
    - Material listing

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/wechat_api.py (reported line 109)May include surrounding context.

python
return result

    def get_access_token(self, force_refresh: bool = False) -> str:
        """Get access token, using cached if valid.

        Args:
            force_refresh: Force refresh token even if current one is valid.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes a direct example calling api.delete_draft("草稿media_id") and printing success, but it does not warn users that the operation deletes content from the公众号草稿箱. Under the markdown-file criteria for SQP-2, destructive actions that can affect user data should be accompanied by a warning about impact or irreversibility.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill documentation declares operational capabilities that inherently require network access, file reads, and likely access to configured secrets, but it does not define any explicit tool scope or permission boundaries. In an agent setting, missing scope declarations increases the chance the skill runs with broader-than-necessary privileges, making misuse or unintended data access more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill advertises a delete_draft capability but provides no warning, confirmation flow, or safety guidance for destructive operations. In agent-driven workflows, omission of confirmation requirements can lead to accidental content loss or unauthorized deletion if the tool is invoked from ambiguous or malicious prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The delete_draft tool permanently deletes a draft via api.delete_draft(media_id), which is a destructive operation. Although the docstring states that the function deletes a draft, there is no explicit confirmation step or user-facing warning about the irreversible effect before execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This tool explicitly exposes the raw WeChat access token to any caller of the MCP tool, even though the skill's stated purpose is draft creation and media management rather than credential retrieval. A bearer token can be reused to call privileged WeChat APIs directly, bypassing the skill's intended boundaries and increasing the blast radius if the tool is invoked by an untrusted agent, prompt, or user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function returns a live access token in the tool response without any disclosure, masking, consent step, or usage restriction. Because access tokens are sensitive bearer credentials, exposing them in normal tool output can leak them into agent transcripts, logs, analytics systems, or downstream integrations where they may be harvested and abused.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · src/wechat_api.py (reported line 26)May include surrounding context.

python
- Material listing
    """

    BASE_URL = "https://api.weixin.qq.com/cgi-bin"

    def __init__(self, app_id: str = None, app_secret: str = None, proxy: str = None):
        """Initialize WeChat API client.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes a skill for image upload, draft creation, and publishing, but this client also deletes drafts and enumerates permanent materials. Those are additional content-management capabilities that go beyond the specifically described operations and expand the skill’s effective scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The delete_draft method issues a POST request to the WeChat draft deletion endpoint and returns the result directly. Although the docstring states that it deletes a draft, there is no user-facing confirmation, warning, or disclosure in the implementation around this destructive action.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The publish_draft docstring states this method will 'submit for review,' which implies a review workflow. However, the implementation invokes /freepublish/submit, a publish operation, so the documentation misrepresents the action’s intent and effect.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description limits the skill to 'draft creation and management' plus image upload, creation, and publication, but the README broadens the behavior to '通过自然语言或代码创建、发布公众号文章' and explicitly lists '发布草稿' as a feature. Publishing live content is materially beyond pure draft management and represents a higher-impact operation than the narrow draft-focused description suggests.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The API reference documents the method as 'add_draft' at L140, but the publishing workflow instructs users to call 'create_draft' at L159. This documentation contradicts itself about which operation actually creates drafts, creating intent-code ambiguity for a core capability.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency specifier fastmcp>=0.1.0 is unpinned, so installs may resolve to different versions over time, including vulnerable or behavior-changing releases. In a security-sensitive integration skill that handles WeChat content publishing and requires secrets such as AppID/AppSecret, unpredictable dependency resolution increases supply-chain and reliability risk.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
fastmcp>=0.1.0
requests>=2.28.0

Unverifiable Dependency: fastmcp has 14 known advisory(ies) (CVE-2025-69196 (FastMCP OAuth Proxy token reuse across MCP servers); GHSA-c2jp-c369-7pvx (FastMCP Auth Integration Allows for Confused Deputy Account Takeover); CVE-2025-64340 (FastMCP has a Command Injection vulnerability - Gemini CLI) +11 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

fastmcp has known security advisories, and because the manifest does not pin a version, there is no way to verify whether deployment will use an affected release. This is more concerning in an MCP skill context because FastMCP may mediate authentication, tool exposure, or command execution pathways, so pulling a vulnerable version could enable serious compromise depending on runtime usage.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency specifier requests>=2.28.0 is also unpinned, which allows future installations to pull different versions than originally tested. Because this skill likely performs authenticated HTTP requests to the WeChat API, an unintended downgrade, vulnerable release, or breaking upstream change could affect confidentiality or request integrity.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
fastmcp>=0.1.0
requests>=2.28.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

requests has multiple historical advisories, and without version pinning the actual installed release cannot be verified as patched. Given this skill's likely use of network calls with credentials to external APIs, a vulnerable requests version could expose sensitive data or weaken transport/session handling.

Content

No source excerpt is available for this finding.