Back to skill

Security audit

淘宝天天特卖

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Taobao deals lookup tool, but it embeds and transmits a shared proxy token through a configurable remote endpoint, which warrants Review before installation.

Install only if you are comfortable sending Taobao deal requests through the publisher's cloud proxy and receiving outbound shopping links. The main concern is the embedded proxy token and configurable proxy URL, which could enable proxy abuse or unintended token disclosure; the publisher should rotate the token, remove the source-code fallback, and restrict the allowed proxy host.

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

Hard-Coded Proxy Authentication Token

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 10–11 and 18–22
Vulnerability Type: Hard-coded secret in distributed source code
Risk Level: High

Vulnerable Code

python
PROXY_URL = os.environ.get("PROXY_URL", "https://1439498936-49sz8cryfx.ap-guangzhou.tencentscf.com")
PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")
python
req = urllib.request.Request(
    PROXY_URL, data=body, method="POST",
    headers={"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN},
)

Technical Analysis

The project embeds a reusable proxy authentication token in plaintext as the default value of PROXY_TOKEN. Because the token is distributed with the source package, any person able to download or inspect the Skill can recover it without authorization.

The application automatically places this token in the X-Proxy-Token request header. Environment-based configuration does not mitigate the exposure because the embedded value remains active whenever PROXY_TOKEN is unset.

The proxy URL is also configurable independently. If an attacker or deployment misconfiguration controls PROXY_URL but leaves PROXY_TOKEN unset, the application sends the embedded token to that alternate endpoint. This creates an additional credential-disclosure path.

Attack Path

  1. An attacker obtains the publicly distributed or otherwise accessible Skill package.
  2. The attacker inspects scripts/main.py and extracts the plaintext proxy token.
  3. The attacker constructs requests to the default proxy and supplies the recovered value in the X-Proxy-Token header.
  4. The attacker invokes proxy operations using the Skill's credential until server-side authorization, scope, or rate limits block the requests.
  5. Alternatively, an attacker with control over the execution environment sets PROXY_URL to an attacker-controlled HTTPS endpoint while leaving PROXY_TOKEN unset.
  6. When any tool is invoked, _call_proxy transmits ...[truncated 829 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the plaintext fallback token from source code:

    python
    PROXY_TOKEN = os.environ.get("PROXY_TOKEN")
    if not PROXY_TOKEN:
        raise RuntimeError("PROXY_TOKEN is required")
    
  2. Immediately revoke and rotate the exposed token. Treat it as compromised because it has already been distributed in source code.

  3. Supply credentials through a managed secret facility, such as a cloud secret manager, deployment-platform secret store, or protected environment injection. Do not commit production secrets to the package or repository.

  4. Validate PROXY_URL against an explicit allowlist of trusted HTTPS origins. If endpoint customization is unnecessary, use a fixed trusted endpoint and do not permit environment-based replacement.

  5. Avoid sending credentials across redirects. Configure request handling to reject redirects to untrusted origins and verify the final destination before transmitting authentication headers.

  6. Apply server-side least privilege. Restrict the replacement token to only the three required operations, impose rate and spending limits, and prevent access to unrelated proxy capabilities.

  7. Add token expiration, rotation, revocation, and abuse-monitoring controls. Alert on unusual request volume, source locations, operation patterns, or repeated authorization failures.

  8. Add automated secret scanning to development and release pipelines so embedded credentials block publication.

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

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The code builds outbound requests using a proxy URL and authentication token taken directly from environment variables, then sends user-influenced parameters to that destination without any allowlisting or validation. If an attacker can influence PROXY_URL or deployment configuration, the skill can be redirected to an attacker-controlled endpoint, causing data exfiltration, SSRF-like behavior, or misuse of the embedded proxy token.

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
90% confidence
Finding

The skill declares environment-backed proxy access and external network/API usage, but does not define any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it harder for the host platform to constrain what the skill may access, increasing the risk of unintended network or secret-bearing behavior if the implementation changes or is misconfigured.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example trigger phrases are broad conversational requests, which can overlap with normal user dialogue and cause accidental invocation. Unintended activation can expose shopping queries to the external proxy/API and return affiliate-style purchase links when the user did not explicitly intend to use this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This skill forwards user-supplied query parameters such as page, sort, and item_id to an external proxy service, but the code provides no disclosure, consent, or minimization controls around that data transfer. In an agent setting, silent transmission of user inputs to a third-party endpoint can create privacy and trust risks, especially when users may not expect their requests to leave the local tool boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill states that data is forwarded through a cloud proxy and that it outputs purchase links, but the warning is not prominent and does not clearly communicate user risk. Users may not realize their queries leave the platform or that clicking returned links may take them to third-party destinations with tracking, affiliate attribution, or additional privacy implications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's docstring, comments, error messages, and formatted outputs are consistently hardcoded in Chinese, with no indication that language is optional or that the skill is intentionally region-locked. That creates a natural-language locale constraint without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.