Back to skill

Security audit

拼多多百亿补贴

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but it embeds a reusable proxy authentication token and sends searches to a remote proxy with weak endpoint scoping.

Review before installing. The skill appears limited to product lookup and does not modify local files or make purchases, but your searches are sent to a cloud proxy and the package contains a shared proxy token. Prefer a version that removes the embedded token, fixes the proxy endpoint allowlist, and documents remote data handling clearly.

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, line 10
Vulnerability Type: Hard-coded reusable authentication credential
Risk Level: High

Vulnerable Code

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

The credential is subsequently used as an authentication header:

python
req = urllib.request.Request(
    PROXY_URL, data=body, method="POST",
    headers={"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN},
)

Technical Analysis

The source code includes a reusable proxy authentication token as the default value of PROXY_TOKEN. If the environment variable is absent, every installation uses this embedded credential when sending requests to the configured cloud proxy.

Anyone able to download or inspect the skill package can recover the token without executing the code. HTTPS protects the credential while it is transmitted but does not mitigate disclosure from the distributed source. The exposed token can then be placed in the X-Proxy-Token header of independently constructed requests.

The exact server-side permissions and rate limits associated with the token are not visible in the audited files. Therefore, the maximum impact depends on the proxy's authorization controls and must be verified server-side.

Attack Path

  1. An attacker downloads or otherwise obtains access to the skill package.
  2. The attacker inspects scripts/main.py and extracts the default PROXY_TOKEN.
  3. The attacker identifies the default proxy endpoint declared in the same file.
  4. The attacker constructs HTTP POST requests containing the recovered token in the X-Proxy-Token header.
  5. The proxy accepts those requests as authenticated if the token remains active.
  6. The attacker repeatedly invokes the service within the token's permissions and any applicable server-side limits.

Impact Assessment

Successful exploitation can permit unauthorized use of the cloud proxy under the shared credent ...[truncated 591 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the embedded fallback credential and fail securely when the secret is unavailable:
python
PROXY_TOKEN = os.environ.get("PROXY_TOKEN")
if not PROXY_TOKEN:
    raise RuntimeError("PROXY_TOKEN must be provided through secure runtime configuration")
  1. Immediately revoke and rotate the exposed token because removal from future releases does not invalidate copies already distributed.
  2. Store the replacement credential in a managed secret store or protected runtime environment rather than source code, documentation, package metadata, or version-control history.
  3. Issue separate, short-lived credentials per user, installation, or execution context instead of sharing a global static token.
  4. Apply least privilege so the credential can access only the required product-list operation.
  5. Enforce server-side rate limits, quotas, expiration, token revocation, and anomaly detection.
  6. Validate allowed operation names and request parameters at the proxy rather than relying solely on the client.
  7. Add secret-scanning checks to version control and release pipelines to prevent future credential inclusion.
  8. Review proxy access logs for suspicious use of the exposed token and investigate unexpected traffic or resource consumption.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

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 code sends data to a remote endpoint whose URL is controlled by the PROXY_URL environment variable, and also transmits an authentication token in the request headers. If that environment variable is altered, requests and potentially user-supplied query data can be redirected to an attacker-controlled server, enabling data exfiltration or misuse of the embedded proxy token. The hardcoded default proxy and token further increase exposure if they are reused across deployments.

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

The skill declares network and environment-variable-backed proxy usage but does not specify any explicit tool scope, permissions, or allowed-tools boundary. This weakens least-privilege enforcement and makes it harder to verify what the skill is authorized to access, increasing the risk of unintended network access or misuse of sensitive runtime configuration such as proxy tokens.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file contains user-facing natural-language content entirely in Chinese, including the display name, description, usage examples, and operational guidance. Under the language/locale policy, forcing a specific language without user opt-in or a documented region-specific justification is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's natural-language title and all user-facing output strings are fixed in Chinese, which imposes a language/locale choice on users without opt-in. The file does not indicate that the skill is intentionally region-specific or provide any language selection behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill forwards user search/filter inputs to a third-party proxy service without any visible disclosure, consent mechanism, or notice in the code path. Even if the transmitted fields seem low sensitivity, this creates a privacy and trust risk because user inputs and metadata leave the local skill boundary and are processed remotely by an opaque service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.