Back to skill

Security audit

Wechat Automation Api

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly consistent with WeChat automation, but it exposes real message-sending authority through unsafe API, token, bulk-send, and remote-image behaviors that need review before installation.

Install only if you are comfortable giving the skill control of a logged-in WeChat desktop session. Rotate/remove the committed tokens, use a strong per-install secret, keep the HTTP API bound to loopback, avoid bulk or unsolicited messaging, require explicit human confirmation of recipient and content, and disable remote image URL fetching or WPush monitoring unless you have reviewed and constrained them.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wechat_controller.py:300
Finding

Caller-Controlled Image URL Enables Blind SSRF and Resource Exhaustion

Content
View full analysis

Vulnerability Details

File Location: scripts/wechat_controller.py:300-360
Vulnerability Type: Server-Side Request Forgery and unbounded remote-content processing
Risk Level: High

Vulnerable Code

python
def _download_image(self, url, max_retries=3):
    try:
        url_md5 = hashlib.md5(url.encode('utf-8')).hexdigest()
        cache_path = os.path.join(self.cache_dir, f"{url_md5}.png")

        if os.path.exists(cache_path):
            if os.path.getsize(cache_path) > 0:
                logger.info(f"Using cached image: {cache_path}")
                return cache_path
            else:
                os.remove(cache_path)

        logger.info(f"Starting image download: {url}")

        last_error = None
        for attempt in range(max_retries):
            try:
                response = requests.get(url, timeout=30, headers={
                    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
                })
                response.raise_for_status()

                content_type = response.headers.get('content-type', '')
                if content_type and not content_type.startswith('image/'):
                    if 'text/' in content_type or 'application/json' in content_type:
                        return None

                image = Image.open(BytesIO(response.content))
                image.verify()

                image = Image.open(BytesIO(response.content))
                image.save(cache_path, 'PNG')

                return cache_path

            except requests.RequestException as e:
                last_error = e
                if attempt < max_retries - 1:
                    time.sleep(1)
                continue
            except Exception as e:
                last_error = e
                break

        return None

    except Exception:
        return None

The displayed log messages have been translated into English for report readability; the executable beha ...[truncated 2870 chars]

Remediation
View remediation

Remediation Suggestions

  1. Permit only explicitly supported schemes, preferably HTTPS.
  2. Parse the URL before use and reject embedded credentials, malformed hosts, and unexpected ports.
  3. Resolve the hostname and reject all loopback, private, link-local, multicast, reserved, unspecified, and metadata-service addresses for both IPv4 and IPv6.
  4. Revalidate the destination after DNS resolution and before each connection to reduce DNS rebinding exposure.
  5. Disable automatic redirects or validate every redirect destination using the same rules.
  6. Download with stream=True and stop processing when a conservative byte limit is exceeded.
  7. Validate Content-Length when present, while retaining a streaming limit because that header is not trustworthy.
  8. Configure Pillow decompression-bomb protections and enforce maximum image dimensions and pixel counts.
  9. Store successful cache files with restrictive permissions, enforce a total cache quota, and expire old files.
  10. Apply request-rate and queue-size limits to the API.
  11. If arbitrary remote images are not essential, accept only local files from an approved directory or require the caller to upload bounded image data directly.

T09 · Insecure Skill Coding Practices

Warning
Location
test_send.py:5
Finding

Generated Deployment API Token Is Committed in Plaintext

Content
View full analysis

Vulnerability Details

File Location: test_send.py:5-15
Additional Locations: README_部署完成.md:17, README_部署完成.md:43, README_部署完成.md:55, README_部署完成.md:67, README_部署完成.md:101
Vulnerability Type: Hardcoded authentication credential
Risk Level: Medium

Vulnerable Code

python
url = "http://127.0.0.1:8808/"

data = {
    "token": "B3S6GiMbIPW1nX4VrK8JTkuEhoFcON9t",
    "action": "sendtext",
    "to": ["File Transfer Assistant"],
    "content": "Deployment verification message"
}

response = requests.post(url, json=data)

The recipient and message strings have been translated into English for report readability. The hardcoded token and relevant executable behavior are reproduced exactly.

The same token is explicitly identified as the generated deployment token in README_部署完成.md and is repeated in several request examples.

Technical Analysis

A token described by the project documentation as a generated deployment credential is stored directly in a tracked Python file and deployment document. Anyone with access to the project package, source repository, backups, logs, or redistributed documentation can recover it.

The service uses the token as the principal authorization boundary:

python
return token == config.get('token')

Possession of the token therefore authorizes message and image actions. Although the documented default endpoint is bound to 127.0.0.1, the host is configurable. The credential is exploitable by any local process and by remote clients if the service is rebound, forwarded, proxied, or otherwise exposed.

The token should be considered compromised even if it has since been changed, because it may remain present in repository history or copied deployment artifacts.

Attack Path

  1. An attacker obtains a copy of the project, deployment document, test script, repository history, or backup.
  2. The attacker extracts the plaintext token.
  3. The attacker reaches the Flask API loc ...[truncated 1143 chars]
Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the disclosed token immediately.
  2. Remove the credential from executable code, documentation, repository history, release archives, backups, and copied deployment artifacts.
  3. Generate a unique, cryptographically random token for every installation.
  4. Load the token from a protected environment variable, operating-system credential store, or dedicated secret manager.
  5. Set restrictive file permissions on any local configuration containing the replacement token.
  6. Replace real credentials in documentation with clearly nonfunctional placeholders.
  7. Use hmac.compare_digest() or an equivalent constant-time operation for token verification.
  8. Keep the service bound to loopback unless remote access is explicitly required.
  9. For remote use, require TLS, network access controls, per-client credentials, token rotation, request auditing, and rate limiting.
  10. Add automated secret scanning to source-control and release pipelines.

T09 · Insecure Skill Coding Practices

Note
Location
test/test_api.py:10
Finding

Predictable Shared Sample Token Encourages Trivially Guessable Deployments

Content
View full analysis

Vulnerability Details

File Location: test/test_api.py:10-11
Additional Locations: README.md:79-122, 使用说明.md:97-241, 快速启动指南.md:76-141
Vulnerability Type: Weak default or example authentication credential
Risk Level: Low

Vulnerable Code

python
BASE_URL = "http://127.0.0.1:8808"
TOKEN = "123123"

Technical Analysis

The test suite and numerous operational examples use the short, predictable token 123123. The associated requests target loopback and therefore do not, by themselves, transmit the token to an external server. The static pre-scan alerts for these requests are consequently not evidence of external data exfiltration.

The security issue is that documentation and executable examples normalize a trivially guessable shared secret. An operator who copies the examples or retains the placeholder in config.json may deploy an API whose authentication credential can be guessed immediately.

No startup validation was found that rejects known placeholders, short credentials, or low-entropy tokens.

Attack Path

  1. An operator follows the examples and configures or retains 123123 as the API token.
  2. The service is accessible to an untrusted local process or is exposed beyond loopback.
  3. An attacker guesses the documented token without needing credential theft or brute-force resources.
  4. The attacker submits authenticated text or image requests.
  5. The service queues and executes the requests through the logged-in WeChat client.
  6. The attacker may additionally invoke the arbitrary image URL-fetch functionality.

Impact Assessment

If the sample token is retained, an attacker can authenticate to the message-sending API and cause the WeChat client to send attacker-selected content. The resulting scope includes message impersonation, spam, social engineering, and access to the image-fetch SSRF primitive.

The default loopback binding reduces exposure to local processes. The impact becomes mate ...[truncated 128 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace 123123 in all examples with an unmistakable nonfunctional placeholder such as REPLACE_WITH_RANDOM_SECRET.
  2. Generate a strong random token during installation rather than requiring users to invent one.
  3. Refuse to start when the configured token is missing, too short, present in a denylist of example values, or below an appropriate entropy threshold.
  4. Read test credentials from an isolated test fixture or environment variable.
  5. Clearly distinguish test-only values from deployment configuration.
  6. Add authentication failure rate limiting and temporary lockout controls.
  7. Add a deployment check that warns or fails when the API is bound beyond loopback without stronger transport and network protections.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (80)

Known Vulnerable Dependency: selenium==3.141.0 — 2 advisory(ies): CVE-2022-28108 (Selenium Server (Grid) before 4 allows CSRF because it permits non-JSON content ); CVE-2023-5590 (NULL Pointer Dereference in GitHub repository seleniumhq/selenium prior to 4.14.)

Critical
Category
Supply Chain
Confidence
98% confidence
Finding

selenium==3.141.0 is flagged with known advisories and is an outdated major version. Even if the specific vulnerable components may depend on how Selenium is used, keeping a known-vulnerable automation framework in a desktop-control skill increases attack surface and maintenance risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims it can send to a specified person or send images, but the finding indicates recipient targeting and image sending may not actually be implemented and behavior may depend on whichever chat is currently focused. In this context, that is especially dangerous because the skill interacts with real contacts/groups, so GUI-state dependence can cause accidental delivery of sensitive content to the wrong person.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims it can send to a specified person or send images, but the finding indicates recipient targeting and image sending may not actually be implemented and behavior may depend on whichever chat is currently focused. In this context, that is especially dangerous because the skill interacts with real contacts/groups, so GUI-state dependence can cause accidental delivery of sensitive content to the wrong person.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims it can send to a specified person or send images, but the finding indicates recipient targeting and image sending may not actually be implemented and behavior may depend on whichever chat is currently focused. In this context, that is especially dangerous because the skill interacts with real contacts/groups, so GUI-state dependence can cause accidental delivery of sensitive content to the wrong person.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims it can send to a specified person or send images, but the finding indicates recipient targeting and image sending may not actually be implemented and behavior may depend on whichever chat is currently focused. In this context, that is especially dangerous because the skill interacts with real contacts/groups, so GUI-state dependence can cause accidental delivery of sensitive content to the wrong person.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: pytest==7.4.3 — 2 advisory(ies): CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)

High
Category
Supply Chain
Confidence
88% confidence
Finding

pytest==7.4.3 is identified as having known advisories, but it is primarily a development/test dependency and may not be present in production execution. That lowers direct runtime risk, yet shipping vulnerable test tooling still reflects poor dependency hygiene and could matter in CI or developer environments.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
80% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · wx_send.py (reported line 24)May include surrounding context.

python
wechat_windows[0].activate()
    time.sleep(0.3)
    
    # Copy message to clipboard
    pyperclip.copy(message)
    time.sleep(0.1)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README positions this as a local WeChat send skill, but it also documents a continuously running HTTP API and queue listener that accepts requests over localhost. That expands the trust boundary from direct local invocation to any local process able to reach the port, which can enable unintended message sending or abuse by other software on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README does not prominently warn that using the skill can send real messages to actual WeChat contacts and may also trigger remote image downloads or push notifications. In an agent context, that omission is risky because users and orchestrators may assume the skill is purely local or simulation-only when it actually causes real external effects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented feature set includes downloading remote images by URL and sending WPush mobile notifications, which are external network actions beyond simple local WeChat automation. These extra transmission paths increase the chance of data exfiltration, SSRF-like fetch behavior, or unexpected outbound communications not obvious from the skill metadata.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A disconnect monitor that sends WPush alerts is outside the narrow purpose of sending WeChat messages and introduces an additional outbound notification channel. Even if intended for reliability, it can leak host state or operational information to a third-party service and broadens the attack surface.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation materially expands the skill from simple one-off WeChat sending into semi-automated bulk messaging across multiple contacts. In this skill context, that enables spam, unsolicited outreach, and higher-volume misuse while relying on UI automation that can also misdirect messages if the wrong chat window is focused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The markdown provides operational guidance for bulk message sending without clear warnings about abuse potential, accidental sends, or account and recipient impact. Because the skill is specifically for messaging real contacts on a consumer platform, omission of these warnings makes misuse more likely and amplifies harm.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The security section claims the automation is undetectable and has no ban risk, which is an unsafe and unsupported assurance. Such claims encourage risky operator behavior, reduce caution, and can facilitate policy-violating use because users are told there is effectively no downside.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

A no-risk guarantee about detection and bans is misleading security guidance in documentation for messaging automation. In practice, this can normalize abusive or high-volume use and suppress operator judgment, making downstream misuse and user-account harm more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README exposes a live-looking authentication token and repeatedly demonstrates its use, effectively turning secret material into public documentation. Anyone with local or forwarded access to this file could invoke the messaging API, send unauthorized messages, and abuse the logged-in WeChat session until the token is rotated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README encourages automated outbound and bulk WeChat messaging without prominent warnings about consent, privacy, recipient data handling, or anti-abuse constraints. In a messaging automation skill, that omission materially increases the risk of spam, privacy violations, and misuse by operators who may treat the examples as endorsed behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest frames the skill as sending WeChat text or images to a person, with trigger phrases centered on messaging '[某人]'. This README explicitly documents batch sending to multiple contacts in one request, which is a broader messaging capability than the described one-to-one notification behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares no explicit tool scope or permission boundaries even though it invokes shell commands and, by description and static analysis, may read files and access the network. In an agent setting, missing scope declarations make it harder to enforce least privilege and increase the chance the skill is invoked with broader capabilities than users expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad and overlap with ordinary conversational requests like notifying someone or sending a picture. For a skill that can transmit messages to real people on the local machine, overbroad invocation increases the chance of accidental activation and unintended real-world actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description emphasizes convenience but does not clearly warn that it sends messages to real contacts/groups and may expose private content or misdeliver messages. In this context, missing user-facing risk disclosure makes accidental harmful use more likely because the action has immediate external effects beyond the agent environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language comments and usage instructions are entirely in Chinese, and the script's user-facing prompts are also Chinese-only. Under the policy, a skill that forces a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script reads an arbitrary contact list from a file and iterates over it to send the same message repeatedly, which expands the capability from one-off user-directed messaging to bulk outbound communication. In an automation skill that controls a real messaging client, this increases the risk of spam, social engineering at scale, accidental mass delivery, and misuse beyond the declared skill scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document explicitly describes a Skill entrypoint that directly controls a local WeChat client to send text or images to real recipients, but it does not mention any user-consent, confirmation, recipient verification, or safety warning requirements. In an agent context, this is dangerous because it enables immediate real-world outbound communication, increasing the risk of misdelivery, spam, social engineering, or unintended disclosure of sensitive information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The changelog documents a new outbound Wpush alerting feature that sends notifications when WeChat automation is judged offline, but it provides no indication of what data leaves the machine, where it is sent, or whether users consent to that transmission. In a local automation skill that controls desktop messaging software, silent outbound notifications increase privacy and operational risk because status details, host identifiers, or message context could be transmitted to a third-party service without clear user awareness.

Content

No source excerpt is available for this finding.