Back to skill

Security audit

京东自营历史最低价

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it embeds a reusable proxy token and sends shopping searches through an external proxy, which deserves user review before installation.

Install only if you are comfortable with your JD shopping search terms being relayed through the publisher's Tencent Cloud proxy. The publisher should rotate the exposed token, remove the hardcoded fallback secret, and clearly document the exact proxy data flow and retention behavior.

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

Hard-Coded Proxy Authentication Token

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 14–15 and 27
Vulnerability Type: Hard-coded authentication secret
Risk Level: Medium

Vulnerable Code

python
PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")
PROXY_URL = os.environ.get("PROXY_URL", "https://1439498936-fmw9ldxblp.ap-guangzhou.tencentscf.com")

The embedded token is subsequently transmitted as an authentication header:

python
headers = {"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN}

Technical Analysis

The source code contains a reusable proxy authentication token as the default value of the PROXY_TOKEN environment variable. Because the skill package is distributed to users, anyone with access to it can recover the token without executing the skill.

The token is automatically sent in the X-Proxy-Token header to a fixed Tencent Cloud Function endpoint. An attacker can reproduce this request outside the skill and submit arbitrary parameter payloads accepted by the proxy. Using an environment variable does not protect the credential while a valid fallback secret remains embedded in the source.

The audit did not verify the remote service's authorization policy, so the token's exact privileges cannot be established from the reviewed files. The exposed credential nevertheless eliminates secrecy as an authentication control.

Attack Path

  1. Obtain or download the skill package.
  2. Inspect scripts/main.py and extract the default proxy URL and token.
  3. Construct an HTTPS POST request to the configured Tencent Cloud Function endpoint.
  4. Add the recovered value to the X-Proxy-Token header.
  5. Submit requests directly to the proxy, independently of the intended skill interface.
  6. Repeatedly consume any operations, quotas, or backend access that the server associates with the token.

Impact Assessment

An attacker may impersonate an authorized skill client and consume the proxy service without possessing ...[truncated 494 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the hard-coded fallback and require protected secret injection:
python
PROXY_TOKEN = os.environ.get("PROXY_TOKEN")
if not PROXY_TOKEN:
    raise RuntimeError("PROXY_TOKEN is required")
  1. Immediately revoke and rotate the exposed token, because removing it from a future release does not invalidate copies of the current package.
  2. Store and inject the replacement credential through the platform's secret manager rather than source code, documentation, metadata, command-line arguments, or committed configuration.
  3. Prefer short-lived, per-installation or per-user credentials over one shared static token.
  4. Enforce server-side authorization that limits the credential to the exact required operation, such as get_lowest_picks.
  5. Validate all request parameters on the proxy and reject undeclared tool names or unsupported fields.
  6. Apply per-credential rate limits, quotas, expiration, revocation, and abuse monitoring.
  7. Avoid treating possession of a publicly distributed client-side value as sufficient authentication. Where feasible, route requests through a trusted platform service that keeps credentials server-side.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The code sends a secret-bearing request to a network endpoint whose URL is configurable via the environment, and both PROXY_URL and PROXY_TOKEN have insecure hardcoded defaults. If an attacker can influence deployment environment variables or reuse the published defaults, requests and the proxy credential can be redirected to an attacker-controlled service, exposing query data and enabling abuse of the backend proxy. In this skill context, all user queries are funneled through that proxy, so compromise affects every invocation.

Content

Scanner excerpt · scripts/main.py (reported line 33)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=timeout) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except (socket.timeout, TimeoutError):
        return {"ok": False, "error": "timeout"}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares network and environment-variable capabilities via tool configuration but does not explicitly constrain tool scope with permissions or allowed-tools metadata. This weakens least-privilege guarantees and can make capability review, policy enforcement, and future maintenance harder, especially because proxy credentials and outbound requests are involved.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The invocation examples are broad and resemble ordinary shopping conversation, which increases the chance of unintentional or overly eager skill activation. If auto-invoked, the skill could trigger network-backed queries without clear user intent, causing unnecessary external data sharing or confusing behavior in general shopping chats.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and subsequent user-visible summaries/errors are written exclusively in Chinese, with no indication that the user can choose another language. This can violate language/locale policy when a skill imposes a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

A sensitive proxy token is embedded and used for outbound requests, but the user is not informed that their search terms are sent to a third-party proxy service. This creates a data-handling and secret-management risk: user input is transmitted off-box, and the hardcoded fallback credential is effectively exposed to anyone with code access. The skill description mentions a proxy, which slightly reduces surprise, but it does not mitigate the security issue of embedding and using a reusable secret this way.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.