Back to skill

Security audit

wechat-message

Security checks for vulnerabilities and agentic risk

Overview

This WeChat automation skill can read private chats, send replies, and forward chat content to a configurable AI endpoint while also claiming that no data is uploaded.

Review before installing. Use only with contacts and chats you are allowed to automate, prefer a local HTTPS or trusted AI endpoint, avoid putting API keys on the command line, delete or protect wechat_automation.log, and do not run auto_process unless you accept unattended replies being sent from your WeChat account.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wechat.py:1694
Finding

Private WeChat Messages and API Credentials Can Be Transmitted to Arbitrary Plaintext Endpoints

Content
View full analysis
None: ``` ```python latest_messages = self._get_latest_messages(message_rects) if latest_messages: # Call the AI interface to obtain replies ai_replies = self._call_ai_api(latest_messages, api_url, api_key) ``` ```python def _call_ai_api(self, customer_messages: List[str], api_url: str, api_key: str) -> List[Dict[str, Any]]: try: headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" } # Combine customer messages into one string combined_message = "\n".join(customer_messages) data = { "user_id": "7", "message": combined_message, "username": "" } self.logger.info(f"调用AI接口: {api_url}") self.logger.info( f"请求消息: {len(customer_messages)}条,合并为: " f"{combined_message[:50]}..." ) response = requests.post( api_url, json=data, headers=headers, timeout=30 ) ``` ### Technical Analysis The automatic-reply feature extracts incoming WeChat messages from the desktop interface, joins them into a single string, and submits them verbatim to `api_url`. The request also includes the configured API credential as a bearer token. The destination is entirely controlled through the `--api_url` argument. The implementation does not: - Require HTTPS for non-loopback destinations. - R ...[truncated 2256 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/wechat.py:847
Finding

Private Message Content and Complete API Responses Are Written to Persistent Logs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/wechat.py:1767
Finding

API Credentials Are Accepted Through Command-Line Arguments and Partially Printed

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
skill.md:20
Finding

Third-Party Dependencies Are Installed Without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding points to the same risky launch site: subprocess.Popen(..., shell=True). The issue is the unnecessary shell mediation around process creation, which can turn environment/path manipulation into command execution opportunities.

Content

Scanner excerpt · scripts/wechat.py (reported line 251)May include surrounding context.

python
startupinfo.wShowWindow = 1
                    CREATE_NO_WINDOW = 0x08000000

                    process = subprocess.Popen(
                        [wechat_path],
                        startupinfo=startupinfo,
                        shell=True,

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding points to the same risky launch site: subprocess.Popen(..., shell=True). The issue is the unnecessary shell mediation around process creation, which can turn environment/path manipulation into command execution opportunities.

Content

Scanner excerpt · scripts/wechat.py (reported line 251)May include surrounding context.

python
startupinfo.wShowWindow = 1
                    CREATE_NO_WINDOW = 0x08000000

                    process = subprocess.Popen(
                        [wechat_path],
                        startupinfo=startupinfo,
                        shell=True,

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code implements automated extraction of message content and external/API-driven reply behavior, which is not obviously necessary for simple local UI automation. In context, this broadens the capability from desktop control to autonomous surveillance and relay of private chat data.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The automatic contact-processing loop collects recent messages, sends them to another system for response generation, and then sends replies autonomously. This creates an end-to-end pipeline for surveillance and automated action on private chats, which is especially risky in a messaging automation skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Customer messages are sent to an external AI API without a clear warning about data sharing, destination, retention, or sensitivity. Because the data consists of private chat content, silent transmission creates a substantial confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow automatically packages chat content and forwards it to an external AI service as part of normal operation. In this skill context, that is a direct sensitive-data disclosure path involving personal communications, making the behavior materially dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill claims no data is uploaded while documenting AI API-based automatic replies, which strongly implies that message contents may be sent off-host for processing. In a WeChat automation context, this is especially sensitive because private conversations, business messages, and personal identifiers could be disclosed to external services without users understanding the risk.

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.

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/wechat.py (reported line 217)May include surrounding context.

python
# 尝试在PATH中查找
        if IS_WINDOWS:
            try:
                result = subprocess.run(['where', 'WeChat.exe'],
                                        capture_output=True, text=True, encoding='gbk',
                                        creationflags=subprocess.CREATE_NO_WINDOW)
                if result.stdout:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The code launches WeChat with subprocess.Popen([wechat_path], shell=True). Even though it passes a list, enabling shell=True unnecessarily routes execution through the shell and increases the risk of path/parameter interpretation issues if the discovered executable path is ever influenced by environment or filesystem manipulation. In a desktop automation skill that already manipulates a privileged GUI session, spawning processes through the shell is more dangerous than necessary.

Content

Scanner excerpt · scripts/wechat.py (reported line 251)May include surrounding context.

python
startupinfo.wShowWindow = 1
                    CREATE_NO_WINDOW = 0x08000000

                    process = subprocess.Popen(
                        [wechat_path],
                        startupinfo=startupinfo,
                        shell=True,

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/wechat.py (reported line 272)May include surrounding context.

python
# macOS启动
                self.logger.info("macOS启动微信")
                try:
                    subprocess.run(['open', '-a', 'WeChat'],
                                   capture_output=True, text=True, timeout=10)
                    self.logger.info("使用open命令启动微信")
                except Exception as e:

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/wechat.py (reported line 278)May include surrounding context.

python
except Exception as e:
                    self.logger.warning(f"open命令失败,尝试其他方法: {e}")
                    try:
                        subprocess.run(['open', '-a', '微信'],
                                       capture_output=True, text=True, timeout=10)
                        self.logger.info("使用中文名启动微信")
                    except Exception as e2:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function comment says it returns only the other party's messages, but the implementation includes both 'me' and 'you' sides. This kind of privacy-affecting mismatch can cause downstream consumers to over-collect or disclose data under a false assumption of limited scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill copies chat history from the GUI into the system clipboard and reads it programmatically without a clear user-facing warning or consent flow. Clipboard-based access can expose sensitive message contents to other local processes and surprises users because private chat data is being harvested through desktop automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill performs automated polling and message sending in an infinite loop with limited runtime transparency. In a messaging context this can lead to unintended autonomous actions, spam, disclosure, or user-account misuse if enabled without clear ongoing notice and operator control.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is presented as a local desktop WeChat automation tool, but it also forwards collected chat messages to a configurable AI API for reply generation. This mismatch is security-relevant because users may reasonably expect local-only processing while private communications are actually transmitted off-host.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
99% confidence
Finding

requests.post(api_url, json=data, ...) transmits combined customer messages to a configurable external endpoint. Because the payload contains private chat content and the destination can be changed, this is a concrete exfiltration mechanism rather than merely a theoretical concern.

Content

Scanner excerpt · scripts/wechat.py (reported line 1723)May include surrounding context.

python
self.logger.info(f"调用AI接口: {api_url}")
            self.logger.info(f"请求消息: {len(customer_messages)}条,合并为: {combined_message[:50]}...")

            response = requests.post(
                api_url,
                json=data,
                headers=headers,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document states that all operations are local and no data is uploaded, but other sections explicitly describe sending content to an external AI API for automatic replies. This can mislead users into exposing chat contents, contact data, or metadata to a network service without informed consent or proper security review.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/wechat.py (reported line 683)May include surrounding context.

python
try:
            config = {}
            for field_name in self.region.__dataclass_fields__:
                value = getattr(self.region, field_name)
                if isinstance(value, tuple):
                    config[field_name] = list(value)
                else:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

Most of the skill is written in Chinese, but the authentication section switches to English imperative instructions such as 'All requests require' and 'Environment Variable' with no opt-in or explanation. This can constitute a language-policy issue because the skill imposes mixed-language instructions on the user without documenting the requirement or offering a choice.

Content

No source excerpt is available for this finding.