Back to skill

Security audit

wechat hot content

Security checks for vulnerabilities and agentic risk

Overview

The skill’s purpose is coherent, but its data-fetching script disables TLS certificate and hostname verification, so users should review it before installing.

Install only if you are comfortable sending search keywords and dates to the external trend API and accepting locally generated reports. The main issue to resolve before broad use is the script’s disabled TLS verification, which can let an attacker on the network alter the API response and inject misleading links into the report.

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

Error
Location
scripts/fetch_gzh_trends.py:130
Finding

TLS Certificate and Hostname Verification Disabled

Content
View full analysis

Vulnerability Details

File Location: scripts/fetch_gzh_trends.py, lines 130–134
Vulnerability Type: Improper TLS certificate validation
Risk Level: High

Vulnerable Code

python
sock = socket.create_connection((host, 443), timeout=timeout)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
ssl_sock = context.wrap_socket(sock, server_hostname=None)

Technical Analysis

The script establishes an HTTPS connection using a raw socket but explicitly disables both certificate-chain validation and hostname verification. It also omits Server Name Indication by passing server_hostname=None.

Consequently, the TLS channel encrypts traffic but does not authenticate the remote server. Any certificate presented during the handshake is accepted, including a self-signed certificate controlled by an attacker.

The affected connection sends the user's search keyword and optional start date to the fixed API endpoint at onetotenvip.com. The response is parsed as JSON and used to generate local HTML and JSON reports. Although article URLs are restricted to the HTTP and HTTPS schemes, they are not restricted to trusted hosts. Therefore, forged API data can introduce attacker-controlled HTTP(S) links into generated reports.

Attack Path

  1. A victim runs the trend-fetching script on a network that an attacker can intercept or influence.
  2. The attacker redirects or intercepts the connection to onetotenvip.com, such as through a malicious access point, compromised router, DNS manipulation, or another network-positioned attack.
  3. The attacker presents an arbitrary TLS certificate.
  4. The script accepts the certificate because certificate validation and hostname checking are disabled.
  5. The attacker receives the submitted query metadata and returns a forged JSON response matching the expected API structure.
  6. The script processes the forged article records and embeds attacker-c ...[truncated 884 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the custom unverified TLS implementation with a maintained HTTPS client that verifies certificates by default:
python
import requests

response = requests.get(
    base_url,
    params=params,
    headers=headers,
    timeout=60,
)
response.raise_for_status()
data = response.json()
  1. If raw sockets are strictly necessary, use the platform trust store and enable hostname verification:
python
sock = socket.create_connection((host, 443), timeout=timeout)
context = ssl.create_default_context()
ssl_sock = context.wrap_socket(sock, server_hostname=host)
  1. Remove all insecure settings:
python
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
server_hostname = None
  1. Fail closed on certificate, hostname, handshake, and response-validation errors. Do not retry through an unverified transport.

  2. Validate the API response against an explicit schema before generating reports, including expected types, collection-size limits, and string-length limits.

  3. Consider restricting returned article links to expected trusted domains if the service contract permits it. Scheme-only validation prevents javascript: URLs but does not prevent phishing links on arbitrary HTTP(S) hosts.

  4. Add automated tests confirming that self-signed, expired, mismatched-hostname, and untrusted certificates are rejected.

Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares network access and writes output files, but the manifest does not define any explicit tool scope such as allowed-tools or permissions. That creates an overbroad execution model where the agent may use capabilities beyond what is minimally required, increasing the chance of unintended network access, data exfiltration, or unsafe file writes if the runtime grants defaults.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description at L003 is written only in Chinese, and the rest of the file consistently assumes Chinese-language interaction. Because the skill does not state that it is region-specific or offer an opt-in language choice, this is a natural-language locale policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Lines L091-L095 require the assistant to use fixed Chinese boundary phrases verbatim. This forces a specific language in user-facing output and does not provide any alternative based on user preference or locale, which matches the policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document advertises a --debug mode that prints raw API responses but does not warn that those responses may contain sensitive or internal data. In an agent or shared logging environment, enabling debug output can leak access tokens, identifiers, request metadata, or unpublished content into logs, transcripts, or generated artifacts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

L060-L062 明确说明“作品链接”应直接使用 oriUrl 字段且“无备用方案”,但 L158 和 L169 的 HTML 示例却使用 https://mp.weixin.qq.com/s/{photoId} 拼接文章链接。这不是单纯的文档不完整,而是两处关于同一功能的说明彼此冲突,可能导致实现者生成与声明不一致的链接行为。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script hard-codes Accept-Language: zh-CN,zh;q=0.9, and the generated HTML also declares lang="zh-CN", indicating the skill is designed to operate in a fixed locale. There is no option for the user to choose another language or locale, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring states a concrete guarantee: '必须覆盖 ≥3 个分类'. However, the function does not check for or enforce a minimum of three categories before returning results; it simply iterates over whatever categories are present and may return one or two categories.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
66% confidence
Finding

The entire skill documentation is presented only in Chinese and does not indicate that users may choose another language or locale. If this skill is intended for general use rather than a clearly region-specific audience, that can conflict with language-choice policy requiring opt-in or documented justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest emphasizes article data collection and insight generation for reference, which implies querying and presenting analytics. This script goes beyond in-memory analysis/output by persisting results to a local file automatically, which is additional behavior not stated in the description.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
scripts/fetch_gzh_trends.py:132