Back to skill

Security audit

淘宝好券精选

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a Taobao coupon lookup tool, but it ships a hardcoded proxy authentication token and sends it with network requests, which needs review before installation.

Install only if you are comfortable with coupon queries being sent to the skill publisher's cloud proxy. The publisher should remove and rotate the embedded proxy token, avoid sending credentials to arbitrary environment-configured URLs, and use tightly scoped managed configuration before this is treated as routine.

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:10
Finding

Hardcoded Proxy Authentication Token

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 10 and 19
Vulnerability Type: Hardcoded secret
Risk Level: High

Vulnerable Code

python
PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")

The credential is subsequently transmitted in an HTTP request header:

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

Technical Analysis

The source code embeds a proxy authentication token as the default value of the PROXY_TOKEN environment variable. Because the source is distributed as part of the skill package, anyone with access to the package can extract the credential without executing the skill.

The environment-variable override does not protect the embedded fallback value. When PROXY_TOKEN is absent, every proxy request automatically uses the exposed credential. An attacker can copy the request structure from _call_proxy and reuse the token outside the intended agent environment.

Additionally, PROXY_URL is configurable through an environment variable. If an attacker can influence the skill's environment, they can direct requests to an attacker-controlled HTTPS endpoint and receive the token through the X-Proxy-Token header. The primary confirmed issue remains public disclosure of the hardcoded token.

Attack Path

  1. Obtain or inspect the distributed skill package.
  2. Open scripts/main.py and extract the fallback token from line 10.
  3. Copy the request format implemented by _call_proxy, including the X-Proxy-Token header.
  4. Send requests directly to the default proxy endpoint using the exposed token.
  5. Invoke any operations authorized for that credential until it is revoked, expires, or server-side restrictions block further use.

An alternative path is possible where an attacker controls the execution environment:

  1. Set PROXY_URL to an attacker-controlled HTTPS endpoint.
  2. Run any skill tool without overriding PROXY_TOKEN.
  3. Capture the fa ...[truncated 748 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the hardcoded fallback token and fail securely when the credential is unavailable:
python
PROXY_TOKEN = os.environ.get("PROXY_TOKEN")
if not PROXY_TOKEN:
    raise RuntimeError("PROXY_TOKEN must be provided through secure configuration")
  1. Rotate and revoke the exposed token immediately because inclusion in a distributed package must be treated as credential compromise.
  2. Store the replacement credential in a managed secret store or protected runtime environment rather than source code, documentation, package metadata, or deployment artifacts.
  3. Issue a narrowly scoped credential that permits only the required proxy operations.
  4. Apply server-side expiration, rate limits, usage quotas, request validation, and monitoring.
  5. Restrict the credential to the intended service, deployment identity, or audience where supported.
  6. Avoid unrestricted production overrides of PROXY_URL. Use an allowlisted endpoint or validate the destination against an exact trusted origin before attaching credentials.
  7. Add automated secret scanning to source-control and release pipelines to prevent future embedded credentials.
  8. Review proxy access logs for unauthorized use of the exposed token and investigate anomalous requests.
Vulnerability Patterns
  • 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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (7)

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The request destination and authentication token are sourced from environment variables and then used directly in an outbound HTTP request. In a skill that is expected to perform simple coupon lookups, this creates a powerful exfiltration channel: if the environment is influenced by a platform operator, deployment misconfiguration, or compromised runtime, user-supplied query parameters and returned data can be silently sent to an arbitrary remote endpoint.

Content

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

python
headers={"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN},
    )
    try:
        with urllib.request.urlopen(req, timeout=TIMEOUT) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        err = ""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares tools that rely on environment-provided proxy credentials and outbound network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it harder for the host agent to constrain what the skill may access, especially given the stated use of a proxy and external API calls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example phrases like “好券精选有什么好货”, “最便宜的好券商品”, and especially “看看这个商品详情” are ordinary conversational requests and the file does not define strict activation boundaries or negative examples. This makes it unclear when the skill should activate versus when similar everyday shopping questions should not invoke it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill forwards tool parameters such as page, sort, and item_id to a remote proxy service without any user-facing disclosure, consent, or indication that a third party processes the requests. Even though the current parameters are not highly sensitive, undisclosed transmission to an external service creates privacy and trust risks and could become more serious if the tool later handles richer user input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's docstrings, user-visible errors, and formatted output are all fixed in Chinese, which imposes a specific language/locale on all users. There is no option to select another language or any documented justification that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest describes a product/coupon query skill for Taobao/Tmall deals, which justifies fetching remote data, but not necessarily reading runtime secrets from environment variables. Accessing environment configuration for a proxy URL and authentication token adds a credential-handling capability beyond the user-facing purpose of browsing discounted items.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description focuses on querying selected Taobao coupon-channel products and promotional deal listings. The implemented get_stats tool adds a channel statistics capability, which is not mentioned in the manifest and goes beyond straightforward product query behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.