Back to skill

Security audit

Wechat Article Analyzer

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent article-analysis purpose, but its code can fetch any user-supplied URL instead of only WeChat article URLs, which creates avoidable network-access risk.

Review before installing. Use this only in environments where outbound web requests are acceptable, and prefer running it on clearly valid https://mp.weixin.qq.com article URLs. Avoid giving it arbitrary, shortened, redirected, internal, or private-network URLs. The publisher should add URL allowlisting, redirect validation, clearer consent around network access, narrower triggers, and pinned dependencies before this is treated as low-risk.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/analyze_wechat.py:26
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scripts/analyze_wechat.py, lines 26 and 367
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: Medium

Vulnerable Code

python
response = requests.get(url, headers=headers, timeout=30)
python
parser.add_argument('url', help='微信公众号文章链接')

Technical Analysis

The command-line URL is passed directly to requests.get() without validating its scheme, hostname, port, resolved IP address, or redirect destinations. Although the skill is intended to process articles hosted on mp.weixin.qq.com, the implementation does not enforce that restriction.

An attacker who can control the URL can therefore cause the host running the skill to send HTTP requests to arbitrary destinations. Potential targets include loopback interfaces, private-network services, and cloud instance metadata endpoints. The requests library follows redirects by default, so an apparently permitted public URL could also redirect to an internal destination unless every redirect target is independently validated.

The fetched response is parsed as article content and can be printed to the console or written into Markdown, YAML, or JSON reports. This can expose textual data returned by an internal service.

Attack Path

  1. The attacker supplies an arbitrary URL instead of a legitimate WeChat article URL.
  2. argparse accepts the value without enforcing an approved host or URL scheme.
  3. read_wechat_article() passes the attacker-controlled value directly to requests.get().
  4. The runtime sends the request using its own network position and access.
  5. If the destination returns content compatible with the parser, that content is included in generated output and may be displayed or saved.
  6. The attacker can repeat the process with different hosts, ports, paths, or redirect chains to probe reachable internal services and retrieve textual responses.

Impact Assessment

Successful exploitation grants t ...[truncated 834 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse URLs with urllib.parse.urlsplit() and permit only the https scheme.
  2. Require the normalized hostname to be exactly mp.weixin.qq.com, or use a narrowly defined allowlist if additional official hosts are necessary.
  3. Reject embedded credentials, malformed hostnames, fragments, and unexpected ports.
  4. Resolve the hostname before connecting and reject IPv4 and IPv6 addresses classified as loopback, private, link-local, reserved, multicast, or unspecified.
  5. Disable automatic redirects with allow_redirects=False, or validate every redirect destination using the same scheme, hostname, port, and resolved-address policy before following it.
  6. Protect against DNS rebinding by ensuring the validated address is the address used for the connection, or enforce equivalent outbound restrictions at the network layer.
  7. Apply an outbound firewall or proxy policy that prevents access to loopback, private networks, link-local ranges, and cloud metadata endpoints.
  8. Stream responses and enforce a maximum response size to limit memory exhaustion from attacker-controlled servers.
  9. Return a clear validation error when the supplied URL is not an approved WeChat article URL.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents capabilities that perform network access and can write output files, but it does not declare any tool scope, permissions, or allowed-tools boundaries. This creates a least-privilege and user-consent gap: an agent may invoke external requests or write files without an explicit policy surface, increasing the chance of unintended data egress or filesystem side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly states it will read external article content, yet it provides no warning that it will make outbound requests or retrieve third-party data. Without a disclosure/consent step, users may unknowingly cause external access, which can leak contextual information, surprise users, or violate environment policies around network usage.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is broad enough to match generic mentions like '微信公众号' or '公众号文章', which can cause the skill to auto-activate when the user is only discussing the topic rather than requesting execution. Over-broad activation can lead to unsolicited network fetches, unexpected processing of URLs, and confusing or privacy-impacting behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The automatic-trigger documentation states that the skill runs when a user sends a WeChat article link or keywords, but it does not define clear boundaries for when it should not run. In an agent setting, missing trigger guardrails materially increases the risk of accidental invocation and unintended external requests based on ambiguous user text.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The natural-language instructions and feature descriptions are presented only in Chinese, which can amount to forcing a specific language without user opt-in under the stated policy. There is no indication that the skill is intentionally limited to Chinese-speaking users or that an alternative language is available.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The markdown file explains that the tool automatically reads WeChat article content and can generate Markdown, YAML, and JSON outputs. However, it does not include any user-facing warning that using the tool will make HTTP requests to external WeChat URLs and may write analysis results to local files when --output is used.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower-bound only (requests>=2.25.0), which makes builds non-reproducible and can pull in different versions over time, including vulnerable or breaking releases. In a skill that fetches and analyzes untrusted external WeChat article content, dependency drift increases supply-chain risk and makes it hard to verify whether known fixes are actually present.

Content

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

text
requests>=2.25.0
pyyaml>=5.4.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
87% confidence
Finding

The manifest does not pin requests, so it is impossible to determine whether deployments use a version affected by known advisories, including credential leakage and TLS-related issues. Since this skill retrieves remote article URLs, any HTTP client weakness can become security-relevant if an attacker can influence target URLs, redirects, or authentication behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

pyyaml>=5.4.0 is also unpinned, so the installed version may vary by environment and time. Because PyYAML has a history of unsafe deserialization issues, leaving the version unconstrained increases the chance of deploying an affected release or introducing incompatible behavior unexpectedly.

Content

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

text
requests>=2.25.0
pyyaml>=5.4.0

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

pyyaml has multiple historical security advisories, especially around unsafe deserialization, and the unpinned manifest prevents verification that a safe release is installed. In a tool that may output JSON/OpenCLI adapters and potentially handle structured content, using an affected PyYAML version could enable code execution or parser abuse if YAML is ever processed from untrusted input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

L022 将 HTTP 请求头中的 Accept-Language 强制设为 zh-CN,zh;q=0.9,这是一种自然语言/区域设置约束。文件中没有提供用户 opt-in、配置选项或对该语言限定进行明确的区域性说明,因此符合语言/locale policy violation 的判定条件。

Content

No source excerpt is available for this finding.