Back to skill

Security audit

懂车帝用户搜索和作品订阅

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Dongchedi search and subscription purpose, but it disables HTTPS certificate checks while sending an API key, so it needs review before installation.

Install only if you trust the publisher and are comfortable giving the skill a Redfox API key and allowing it to create daily subscription automations. The TLS verification bug should be fixed before routine use, especially on shared, corporate, or untrusted networks; rotate the API key if it has already been used with this version.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search_user.py:52
Finding

Disabled TLS Certificate Verification Exposes API Credentials in User Search

Content
View full analysis

Vulnerability Details

File Location: scripts/search_user.py, lines 52–60 and 105–125
Vulnerability Type: Improper TLS certificate and hostname validation
Risk Level: Medium

Complete Code Snippet

python
def _ssl_context():
    """Create an SSL context compatible with multiple environments."""
    try:
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE
    except Exception:
        ctx = None
    return ctx
python
req = urllib.request.Request(
    API_URL,
    data=payload,
    headers={
        "Content-Type": "application/json",
        "X-API-Key": api_key,
        "User-Agent": "QoderWork/1.0",
    },
    method="POST",
)

ctx = _ssl_context()
try:
    kwargs = {"timeout": 30}
    if ctx:
        kwargs["context"] = ctx
    with urllib.request.urlopen(req, **kwargs) as resp:
        result = json.loads(resp.read().decode("utf-8"))

Technical Analysis

The client creates a default TLS context but then explicitly disables both hostname checking and certificate validation:

  • ctx.check_hostname = False allows a certificate issued for an unrelated hostname.
  • ctx.verify_mode = ssl.CERT_NONE accepts untrusted, self-signed, expired, or attacker-provided certificates.

The resulting context is passed directly to urllib.request.urlopen. At the same time, the request carries REDFOX_API_KEY in the X-API-Key header. HTTPS encryption without certificate authentication does not establish that the remote endpoint is the intended redfox.hk service.

An attacker capable of intercepting or redirecting the connection can terminate TLS using an arbitrary certificate. Because the client does not authenticate the server, it will transmit the API key to the impersonated endpoint and process the endpoint's JSON response as trusted RedFox data.

Attack Path

  1. A user invokes the Skill to search for a Dongchedi user.
  2. search_user.py reads REDFOX_API_KEY ...[truncated 1357 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the custom context that disables verification and rely on Python's verified default TLS behavior:
python
with urllib.request.urlopen(req, timeout=30) as resp:
    result = json.loads(resp.read().decode("utf-8"))
  1. If a custom SSL context is required, preserve secure validation:
python
ctx = ssl.create_default_context()
ctx.check_hostname = True
ctx.verify_mode = ssl.CERT_REQUIRED
  1. If the deployment requires a private certificate authority, load only the required CA bundle with load_verify_locations() rather than disabling validation globally.

  2. Fail closed when certificate validation fails. Do not retry with CERT_NONE as a compatibility fallback.

  3. Revoke and rotate any API key that may have been used over an intercepted connection.

  4. Apply least-privilege and expiration controls to RedFox API keys to limit the consequences of credential disclosure.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/work_list.py:45
Finding

Disabled TLS Certificate Verification Exposes API Credentials and Subscription Results

Content
View full analysis

Vulnerability Details

File Location: scripts/work_list.py, lines 45–53 and 155–175
Vulnerability Type: Improper TLS certificate and hostname validation
Risk Level: Medium

Complete Code Snippet

python
def _ssl_context():
    """Create an SSL context compatible with multiple environments."""
    try:
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE
    except Exception:
        ctx = None
    return ctx
python
req = urllib.request.Request(
    API_URL,
    data=payload,
    headers={
        "Content-Type": "application/json",
        "X-API-Key": api_key,
        "User-Agent": "QoderWork/1.0",
    },
    method="POST",
)

ctx = _ssl_context()
try:
    kwargs = {"timeout": 60}
    if ctx:
        kwargs["context"] = ctx
    with urllib.request.urlopen(req, **kwargs) as resp:
        result = json.loads(resp.read().decode("utf-8"))

Technical Analysis

The works-list client explicitly disables certificate-chain validation and hostname authentication before transmitting an authenticated request to the RedFox API. Consequently, it cannot distinguish the intended service from an attacker-controlled TLS endpoint.

The request includes REDFOX_API_KEY in the X-API-Key header. The response is then decoded and used as authoritative work metadata. Returned values include titles, author information, image URLs, cover URLs, and work_url. While textual title and author fields receive limited Markdown escaping, returned URL fields are accepted from the response without validation.

This vulnerable path is used both for interactive work retrieval and for the scheduled subscription workflow described in SKILL.md. Scheduled execution increases exposure because requests may run unattended every day, although creation of the subscription itself follows an explicit user subscription request.

Attack Path

  1. A user retrieves a creator's works or explicitly crea ...[truncated 1570 chars]
Remediation
View remediation

Remediation Suggestions

  1. Stop passing an insecure SSL context to urlopen and use the verified default:
python
with urllib.request.urlopen(req, timeout=60) as resp:
    result = json.loads(resp.read().decode("utf-8"))
  1. If a custom context is needed, require certificate verification and hostname matching:
python
ctx = ssl.create_default_context()
ctx.check_hostname = True
ctx.verify_mode = ssl.CERT_REQUIRED
  1. Configure an explicit trusted CA bundle when necessary instead of accepting arbitrary certificates.

  2. Treat TLS validation errors as fatal and avoid insecure fallback behavior.

  3. Validate returned navigation URLs before presenting them:

    • Require https.
    • Restrict links to documented Dongchedi domains if the API contract guarantees those domains.
    • Clearly identify external destinations if a strict host allowlist is not appropriate.
  4. Revoke and rotate potentially exposed RedFox API keys, and scope replacement keys to the minimum required API operations.

  5. Add tests asserting that untrusted certificates, hostname mismatches, and self-signed certificates cause requests to fail.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

描述覆盖了“搜索用户 + 查看作品列表 + 订阅推送”三个主要能力,但给出的代码块只对应其中的“搜索用户”部分。它向 redfox.hk 的 dongchedi/searchUser 接口发送请求,读取 API key,处理分页,并格式化用户结果;没有任何获取某个用户作品列表的接口调用,也没有定时任务、订阅存储、推送逻辑或作品详情输出。因此声明与实际代码行为存在明显不匹配。代码中访问第三方 Redfox API 作为实现细节,与声明的懂车帝用户搜索场景并不构成额外越权能力;真正的问题是声明显著夸大了功能范围。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

代码块仅包含 work_list.py,其实际功能是:读取 Redfox API Key,向 /dongchedi/accountWorks 接口发送 userId,请求作品列表,格式化作品字段,并可按 today/yesterday/指定日期过滤后输出 JSON。这与声明中的“查看用户作品列表”部分基本一致,也确实包含标题、类型、阅读、点赞、评论、收藏、发布时间、原页链接等信息。但声明把技能描述为一个更完整的‘用户搜索和作品订阅工具’,包括搜索懂车帝用户、查看粉丝数和简介、选择用户后订阅、每天自动推送昨日更新作品;这些能力在当前代码中均未出现。由于声明中的核心能力有多项未被该代码支持,描述与实际行为存在明显不一致。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

These lines directly disable hostname and certificate verification without any warning or opt-in, causing all outbound HTTPS requests to trust any presented certificate. In this skill, that exposes the Redfox API key and lets an attacker alter returned user data, links, and metadata, undermining both confidentiality and integrity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation instructs users to reply with the Chinese phrase '查看全部' to expand results, which imposes a specific language requirement. The file does not offer an alternative language option or state that users may choose their preferred locale.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README says users can 'just describe in natural language' what they want with 'no commands to memorize,' which does not define clear trigger boundaries or exclusions. This broad phrasing increases the chance of unintended invocation from ordinary conversation about Dongchedi users or works.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The quick reference says users should reply '订阅' to subscribe, which forces a Chinese-language command. Because no language choice or opt-in is provided elsewhere, this is a locale-policy issue in the natural-language interface.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · README.en.md (reported line 77)May include surrounding context.

md
After selecting a user (e.g., replying "1"), their work list is displayed:

| #   | Publish Time     | Work Title                                                                                        | Type  | Reads | Likes | Comments | Collects |
| --- | ---------------- | ------------------------------------------------------------------------------------------------- | ----- | ----- | ----- | -------- | -------- |
| 1   | 2026-09-28 16:03 | [又想合资又想电动又想舒适智能——别克至境E7再推新](https://www.dcdapp.com/motor/m/feed/detail?link_source=share&group_id=7690492951143268888) | Video | 1145  | 37    | 7        | 0        |

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger guidance is broad and based on natural-language phrases such as brand names, creator lookups, and general Dongchedi-related requests, which can cause the platform to invoke this skill during ordinary conversation without clear user intent. In a skill that performs external searches and supports subscriptions, overbroad activation increases the risk of unintended data retrieval or unintended side effects such as subscribing to updates.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · README.md (reported line 77)May include surrounding context.

md
选中用户(如回复「1」)后,将展示该用户的作品列表:

| #   | 发布时间            | 作品标题                                                                                          | 类型 | 阅读 | 点赞 | 评论 | 收藏 |
| --- | ------------------ | ------------------------------------------------------------------------------------------------- | ---- | ---- | ---- | ---- | ---- |
| 1   | 2026-09-28 16:03   | [又想合资又想电动又想舒适智能——别克至境E7再推新](https://www.dcdapp.com/motor/m/feed/detail?link_source=share&group_id=7690492951143268888) | 视频 | 1145 | 37   | 7    | 0    |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill instructs the agent to use environment variables, read local files, invoke Python scripts, and access external services, but it does not declare any explicit tool scope or allowed-tools boundary. This creates an over-privileged execution model where the runtime may permit broader file, env, or network access than intended, increasing blast radius if the skill is modified, compromised, or prompt-injected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill asks users to place an API key in shell environment variables or a local config file but provides no warning about secret handling, least-privilege, rotation, or avoiding accidental disclosure in logs and shared environments. In agent ecosystems, such instructions can lead to credentials being stored insecurely, copied into transcripts, or exposed to unrelated tools/processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script's docstring, CLI description, help text, and error messages are written entirely in Chinese, which imposes a specific language on all users. There is no indication of user opt-in, alternate locale support, or a documented reason that the tool must be Chinese-only.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The helper explicitly disables both certificate validation and hostname verification for HTTPS requests, which allows a man-in-the-middle attacker to intercept or modify traffic to the Redfox API while the client still treats the connection as trusted. Because the script sends an API key in the request headers and consumes untrusted response data, this can lead to credential theft, response tampering, and misleading search results.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring claims the function creates a compatibility SSL context, but the implementation silently disables core TLS protections. That mismatch increases operational risk because reviewers or maintainers may assume the code is safe while it actually permits spoofed HTTPS endpoints and tampered responses.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code explicitly disables TLS certificate validation by setting check_hostname=False and verify_mode=ssl.CERT_NONE before sending the Redfox API key and user ID to a remote endpoint. This enables man-in-the-middle interception or modification of responses, which is especially risky because the script performs authenticated requests and trusts the returned JSON.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This function transmits the supplied user ID to an external Redfox API and includes a credential in the request header. Although the script's docstring says it calls the API, there is no explicit user-facing warning about sending user-related data off-host or using the configured API key when the request executes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

文档从标题到使用说明均默认使用中文,没有说明是否支持其他语言,亦未给出用户可选择语言的方式。根据规则,若技能强制特定语言且无用户选择或合理限定,可能构成自然语言层面的语言/地区政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file's human-facing description, help text, and error messages are all in Chinese, which effectively constrains the skill's language/locale behavior. There is no indication that this is an opt-in language choice or a documented region-specific requirement.

Content

No source excerpt is available for this finding.