Back to skill

Security audit

Alibaba Ai Search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple Alibaba search URL helper with disclosed attribution tracking and no evidence of hidden, persistent, or destructive behavior.

Before installing, be aware that generated Alibaba links include traffic_type=ags_llm for analytics/attribution. Avoid using untrusted category values with the helper script until category URL encoding or validation is fixed.

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

Note
Location
scripts/build_url.py:35
Finding
Unencoded Category Parameter Allows Query-String Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/build_url.py`, lines 35-39 **Vulnerability Type**: URL query-string injection / parameter pollution **Risk Level**: Low ### Vulnerable Code ```python if args.category: params["categoryId"] = args.category query_string = "&".join(f"{k}={v}" for k, v in params.items()) url = f"https://www.alibaba.com/trade/search?{query_string}" ``` ### Technical Analysis The `--category` argument is controlled by the command-line user and is assigned directly to `params["categoryId"]`. The query string is then constructed through manual string concatenation rather than a URL-encoding function. Because reserved URL characters such as `&`, `=`, and `#` are not encoded, a crafted category value can escape the intended `categoryId` value and introduce additional query parameters or a URL fragment. The search query itself is encoded by `encode_query`, but that protection is not applied to the category value. For example: ```bash python3 scripts/build_url.py search "wireless earbuds" \ --category '44&attackerControlled=value' ``` This produces a URL equivalent to: ```text https://www.alibaba.com/trade/search?SearchText=wireless+earbuds&traffic_type=ags_llm&categoryId=44&attackerControlled=value ``` The injected `attackerControlled` parameter is interpreted independently rather than as part of `categoryId`. ### Attack Path 1. An attacker supplies or persuades a user or automation system to use a crafted category value containing URL delimiters. 2. The value is accepted by the `--category` command-line argument without validation. 3. The script inserts the value directly into the query string. 4. The script prints an apparently legitimate URL on the fixed `www.alibaba.com` host. 5. If that URL is opened or passed to another component, Alibaba or an intermediary processes the injected parameters according to its own parameter-handling rules. This path requires control over the category argument. It does n ...[truncated 615 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Use `urllib.parse.urlencode` to encode every parameter consistently instead of manually joining key-value pairs: ```python params = { "SearchText": args.query, "traffic_type": TRAFFIC_TYPE, } if args.category: params["categoryId"] = args.category query_string = urllib.parse.urlencode(params) url = f"https://www.alibaba.com/trade/search?{query_string}" ``` Because `urlencode` performs value encoding, pass the raw search query rather than the output of `encode_query`; otherwise, percent characters may be encoded twice. If category identifiers are expected to be numeric, add allowlist validation as defense in depth: ```python if args.category: if not args.category.isdigit(): parser.error("--category must contain digits only") params["categoryId"] = args.category ``` Add regression tests using values containing `&`, `=`, `#`, `%`, whitespace, and Unicode. Verify that these characters are encoded within `categoryId` and cannot create separate query parameters. ]]>
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Missing User Warnings

Low
Confidence
87% confidence
Finding
The README explicitly states that all generated URLs include a tracking parameter for analytics and attribution, but it does not warn users about the privacy implications or give them a way to opt out. This is a real transparency/privacy issue because users may unknowingly share attribution metadata when following or distributing generated links, even though the parameter appears low risk and not overtly malicious in this context.

Static analysis

No suspicious patterns detected.