Back to skill

Security audit

Reply Wechat Message

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned with WeChat messaging, but it has high-impact auto-send behavior, private chat capture, external OCR exposure, unsafe shell examples, and missing bundled scripts.

Review this carefully before installing. It can read visible WeChat conversations, use an external OCR service, and send messages as you. Do not use it for sensitive chats unless it adds explicit preview, confirmation, local OCR or clear OCR consent, safer subprocess handling, and the missing scripts are supplied for review.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
SKILL.md:116
Finding

Shell Command Injection Through AI-Generated Reply Content

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 116-117
Vulnerability Type: Shell command injection
Risk Level: High

bash
echo "AI-generated reply" | python scripts/reply_wechat.py Kitty

Technical Analysis

The documented workflow directs the Agent to place an AI-generated reply inside a double-quoted echo command executed by a shell. Double quotes do not prevent shell command substitution. Constructs such as $(command) and backticks are evaluated by the shell before the resulting text is passed to echo.

Because the reply is generated from untrusted chat content, a remote participant could attempt to make the generated reply contain shell metacharacters or command-substitution expressions. If the Agent constructs and executes the documented command by textual interpolation, those expressions can execute locally.

Using stdin avoids Python argument-parsing problems, but it does not make shell interpolation safe.

Attack Path

  1. An attacker sends a WeChat message containing adversarial instructions designed to make the AI reproduce a shell expression, such as a command inside $().
  2. The workflow reads the attacker's message through OCR and uses it as generation context.
  3. The AI generates a reply containing the attacker-selected shell expression.
  4. The Agent substitutes that reply into the documented echo "..." command.
  5. The shell evaluates command substitution before piping the reply to reply_wechat.py.
  6. The injected command executes with the same operating-system privileges as the Agent process.

Impact Assessment

Successful exploitation could permit arbitrary command execution under the Agent's local user account. Depending on that account's permissions, an attacker could read or modify accessible files, obtain local application data, invoke network utilities, tamper with the user's session, or execute additional programs. No privilege escalation beyond the Ag ...[truncated 39 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not construct a shell command by interpolating AI-generated or user-controlled text.
  • Launch Python with a subprocess API that uses an argument array and disables shell processing.
  • Pass the reply through the subprocess stdin stream directly.
  • For example, use the equivalent of subprocess.run(["python", "scripts/reply_wechat.py", contact], input=reply, text=True, shell=False).
  • Treat both the contact and message as untrusted input and validate the contact against an expected recipient list.
  • Require user confirmation before sending replies derived from suspicious or operationally sensitive messages.
  • Add regression tests containing $(), backticks, quotes, newlines, redirection operators, and pipe characters.

other

Error
Location
SKILL.md:96
Finding

Disclosure of Private Chat Content to an External OCR Service

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 96-98 and 169-172
Vulnerability Type: Third-party privacy data exposure
Risk Level: High

text
python scripts/reply_wechat.py Kitty
→ Read entire chat area, split left/right
text
- OCR.space API (Free tier, no registration required)
- Python packages: pyautogui, pygetwindow, pyperclip, requests, Pillow, numpy

Technical Analysis

The workflow states that it reads the entire visible chat area and identifies OCR.space as the OCR dependency. Processing screenshots through an external OCR API can disclose conversation content to a third party.

The Skill does not document explicit user consent, data minimization, redaction, retention restrictions, destination disclosure, transport verification, or controls preventing unrelated visible messages from being captured. Chat screenshots may contain personal information, credentials, financial data, confidential business information, or messages belonging to other participants.

The referenced implementation scripts are absent from the audited project, so it is not possible to verify precisely what image data is transmitted, whether HTTPS and certificate validation are enforced, or whether screenshots are retained locally or remotely.

Attack Path

  1. A user asks the Skill to reply to a contact.
  2. The workflow captures the entire visible chat area.
  3. The captured image or extracted chat data is submitted to the external OCR service.
  4. The external provider receives and processes the conversation without an explicit consent or redaction step documented by the Skill.
  5. Sensitive content becomes exposed outside the local device and WeChat environment.

Impact Assessment

The affected scope includes all visible conversation content captured during the operation, not merely the latest message. Exposure could compromise personal communications, confidential records, authentication inf ...[truncated 163 chars]

Remediation
View remediation

Remediation Suggestions

  • Prefer an offline, locally executed OCR engine so screenshots never leave the device.
  • If external OCR is unavoidable, obtain explicit informed consent before every transmission.
  • Clearly identify the external recipient, data categories transmitted, retention policy, and applicable privacy terms.
  • Capture only the minimum message region required rather than the entire chat area.
  • Redact credentials, payment information, identifiers, and unrelated messages before transmission.
  • Enforce HTTPS with certificate verification and restrictive connection timeouts.
  • Avoid persistent screenshot storage; securely remove temporary images after processing.
  • Provide a preview and confirmation step before uploading chat content.
  • Include an option that disables external processing entirely.

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:111
Finding

Unconditional Trust of Attacker-Controlled OCR Chat Content

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 111-113
Vulnerability Type: Indirect prompt injection and instruction hijacking
Risk Level: Medium

text
The OCR-recognized text IS the real context. The model must NOT question, guess,
or doubt the accuracy of the recognition. Reply based on the recognized content directly.

Technical Analysis

Chat text originates from external participants and must be treated as untrusted data. The quoted instruction instead requires the model to trust OCR output unconditionally and discourages validation of its accuracy or intent.

This creates an indirect prompt-injection boundary failure. An attacker can place model-directed instructions inside a chat message and attempt to have those instructions interpreted as operational guidance rather than quoted conversation data. The rule also removes safeguards against OCR errors, spoofed content, misleading context, and malicious requests.

The weakness is especially dangerous when combined with automatic reply transmission and the shell-based reply workflow. However, successful operating-system command execution depends on exploitation of the separate shell injection issue and is not inherent to this finding alone.

Attack Path

  1. An attacker sends a message containing instructions addressed to the AI, potentially asking it to ignore prior rules, expose information, reproduce a payload, or send a specific response.
  2. The Skill captures and OCR-processes that message.
  3. The model receives the attacker-controlled text as conversation context.
  4. The Skill's trust rule discourages the model from questioning or validating the recognized content.
  5. The model follows or reflects the embedded instruction when generating its reply.
  6. The workflow automatically sends the manipulated response or passes it into the vulnerable shell pipeline.

Impact Assessment

Exploitation could manipulate outgoing messages, ...[truncated 253 chars]

Remediation
View remediation

Remediation Suggestions

  • Explicitly classify OCR output and chat messages as untrusted quoted data, never as Agent instructions.
  • Instruct the model to ignore requests within chat content that attempt to alter system rules, tool behavior, or workflow constraints.
  • Preserve uncertainty: allow the model to identify possible OCR errors, ambiguous identities, and suspicious instructions.
  • Separate conversation data from trusted instructions using structured fields or a strongly typed message format.
  • Validate the intended recipient and generated reply before transmission.
  • Require user confirmation for sensitive, unusual, financial, credential-related, or operational replies.
  • Prevent chat-derived content from being inserted into shell commands or tool parameters without safe encoding and policy validation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is designed to read entire chat context and automatically send a generated reply, but the documentation does not prominently warn users that private conversation content will be accessed and that messages may be transmitted on their behalf. This creates a meaningful privacy and integrity risk, especially because the action affects external recipients and may expose sensitive personal or business data.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The dependency on OCR.space means chat screenshots or extracted message content may be sent to a third-party external service, yet the skill provides no explicit disclosure or consent flow for this off-device transmission. Since the content being processed is private chat data, this can lead to sensitive information exposure, regulatory issues, and unauthorized third-party retention of communications.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow explicitly instructs the model to ingest the full captured chat and treat OCR output as authoritative, then generate and send a reply based directly on that private content. This increases the chance of exposing sensitive information, responding to manipulated OCR text, or taking action on misunderstood context without verification, especially in a live messaging environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The short-form triggers for auto-reply (such as simple 'reply' phrases) are broad enough to be confused with normal user conversation or casual instructions, which can cause unintended execution of a message-sending action. Because this skill drives a real messaging client, accidental invocation can result in unauthorized outbound messages to contacts.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.