Back to skill

Security audit

购物比价助手

Security checks for vulnerabilities and agentic risk

Overview

This is a price-comparison helper, but it should be reviewed because its advertised platform coverage does not match the code and it uses opaque cloud proxy calls with an embedded authentication token.

Review before installing. Treat searches and pasted product links as data sent through the publisher's Tencent cloud proxy, and do not rely on the advertised Pinduoduo or full Taobao coverage unless the publisher updates the skill and removes the embedded shared token.

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/main.py:11
Finding

Hard-Coded Proxy Authentication Token

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py:11-19
Vulnerability Type: Hard-coded authentication secret
Risk Level: High

python
_PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")
PROXIES = {
    "jd": {
        "url": "https://1439498936-9n7zsjnaif.ap-guangzhou.tencentscf.com",
        "token": _PROXY_TOKEN,
    },
    "taobao": {
        "url": "https://1439498936-lofjio3yzf.ap-guangzhou.tencentscf.com",
        "token": _PROXY_TOKEN,
    },
}

The token is subsequently transmitted in an authentication header at scripts/main.py:196-203:

python
def _scf_call(proxy_key: str, req_type: str, params: dict) -> dict:
    """调用SCF代理接口"""
    proxy = PROXIES[proxy_key]
    payload = json.dumps({"type": req_type, "params": params}).encode("utf-8")
    headers = {"Content-Type": "application/json", "X-Proxy-Token": proxy["token"]}
    req = urllib.request.Request(proxy["url"], data=payload, headers=headers, method="POST")
    try:
        with urllib.request.urlopen(req, timeout=PROXY_TIMEOUT) as resp:

Technical Analysis

When the PROXY_TOKEN environment variable is not configured, the application falls back to a reusable authentication token embedded directly in the distributed source code. Any party able to download or inspect the Skill can recover this token without executing the application.

The token is used to authenticate HTTPS requests to two fixed Tencent Serverless Cloud Function endpoints. Sending price-search keywords to these proxy services is consistent with the Skill's declared remote price-comparison functionality and does not, by itself, exceed the minimum privileges needed. However, embedding the proxy credential is unnecessary and breaks secret-management boundaries. HTTPS protects the token while it is in transit but does not protect it from source-code disclosure.

Attack Path

  1. An attacker downloads or otherwise obtains the Skill package.
  2. The attacker reads scripts/main.py and ...[truncated 1180 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the hard-coded fallback token and fail securely when PROXY_TOKEN is unavailable.
  2. Rotate and revoke the exposed token because publication in source code must be treated as credential compromise.
  3. Supply credentials through the platform's protected secret-management mechanism rather than source files, metadata, command-line arguments, or logs.
  4. Issue separate, short-lived, least-privilege credentials per deployment or installation instead of one reusable shared token.
  5. Restrict each credential to the exact proxy operations required for product searches.
  6. Enforce server-side schemas and allowlists for request types and parameters; never rely solely on client-side restrictions.
  7. Add per-token rate limits, quotas, anomaly detection, expiration, and revocation support.
  8. Avoid returning sensitive backend details in proxy error messages, and ensure authentication headers are never logged.
  9. Add automated secret scanning to release and CI pipelines to prevent future credential publication.
  10. Keep HTTPS certificate validation enabled for all proxy traffic.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Tainted flow: 'req' from os.environ.get (line 201, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 203)May include surrounding context.

python
headers = {"Content-Type": "application/json", "X-Proxy-Token": proxy["token"]}
    req = urllib.request.Request(proxy["url"], data=payload, headers=headers, method="POST")
    try:
        with urllib.request.urlopen(req, timeout=PROXY_TIMEOUT) as resp:
            data = json.loads(resp.read().decode("utf-8"))
            return data if data else {}
    except (socket.timeout, TimeoutError):

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The manifest promises full JD, Taobao, and Pinduoduo comparison, but the detected behavior omits Pinduoduo and narrows Taobao results to Tmall-only while claiming broader coverage. This is dangerous because users and upstream agents may make purchasing or trust decisions based on false assumptions about market coverage, which can conceal affiliate bias or incomplete results.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares environment variables for a proxy service and describes network-backed behavior, but it does not define explicit tool scope or permissions boundaries. This can lead to overbroad runtime access or unclear trust assumptions, making review and enforcement harder if the hosting platform relies on manifest-declared restrictions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language policy violations apply to all file types, including markdown. The display name, description, examples, and usage instructions all force Chinese-language interaction, but the file does not offer user opt-in, alternate language support, or a documented region-specific justification for the language constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Because this is a markdown skill file, vague trigger guidance applies. The '你这样说' examples such as '帮我比一下…' and '全平台搜一下…' are natural everyday phrases, and the document does not provide a constrained trigger list, activation scope, or negative examples to distinguish when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module description and all user-facing strings are written in Chinese, and there is no indication that users may opt into another language or locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest promises simultaneous querying of 京东、淘宝、拼多多三大平台, but the implementation defines proxies only for JD and Taobao and returns a 'not supported' hint for Pinduoduo links/requests. This is a clear mismatch between advertised capability and actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-supplied search queries are transmitted to third-party proxy endpoints, and this file provides no notice, consent flow, or minimization for that data transfer. In a shopping assistant context, queries can contain pasted product titles, links, or other incidental personal data, so undisclosed external forwarding creates a real privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The top-level docstring says '跨京东/天猫双平台比价', and the entrypoint docstring also describes only JD/Tmall comparison. This directly conflicts with the manifest description advertising three-platform comparison including 拼多多 and 淘宝.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.