Back to skill

Security audit

极鲸云速卖通商品搜索

Security checks for vulnerabilities and agentic risk

Overview

The skill’s AliExpress research purpose is coherent, but its authentication scripts allow endpoint redirection and duplicate login tokens across local locations, so it needs review before installation.

Install only if you trust the publisher and are comfortable with GeekBI authentication state being stored locally. Avoid using or allowing custom --base-url values, check login links before authorizing, and clear auth state after use on shared or synced workspaces.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/geekbi_auth.py:698
Finding
Unrestricted API base URL permits authentication and sensitive requests to untrusted or cleartext endpoints<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/aliexpress_goods_search.py:56-62` - `scripts/aliexpress_goods_info.py:43-49` - `scripts/aliexpress_site_list.py:63-68` - `scripts/geekbi_auth.py:578-579` - `scripts/geekbi_auth.py:698-724` **Vulnerability Type**: Unrestricted authentication endpoint and insufficient transport validation **Risk Level**: High ### Vulnerable Code From `scripts/aliexpress_goods_search.py:56-62`: ```python parser.add_argument("--base-url", default=DEFAULT_BASE_URL) parser.add_argument("--param", action="append", default=[], help="查询条件,格式为 名称=值") parser.add_argument("--timeout", type=float, default=30) args = parser.parse_args() try: params = parse_params(args.param) payload = authenticated_json_request( build_url(args.base_url, ENDPOINT, params), args.base_url, args.timeout ) ``` Equivalent unrestricted `--base-url` arguments are also exposed by the product-information and site-list entry points. From `scripts/geekbi_auth.py:578-579`: ```python endpoint = f"{base_url.rstrip('/')}{TOKEN_ENDPOINT}" try: response = _post_json(endpoint, {"deviceCode": pending["deviceCode"]}, timeout) ``` From `scripts/geekbi_auth.py:698-724`: ```python def authenticated_json_request( url, base_url, timeout, *, method="GET", body=None, headers=None, ): complete_pending_login(base_url, timeout) request_headers = _api_headers() if headers: request_headers.update(headers) authorization = _authorization_header(base_url) if authorization: request_headers["token"] = authorization request = Request( url, data=body, headers=request_headers, method=method, ) try: with urlopen(request, timeout=timeout) as response: response_payload = _read_json_response(response) _raise_action_if_needed(response_payload) return response_payload ``` ### Technical Analysis All network- ...[truncated 2979 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `--base-url` from production-facing command-line interfaces and use the fixed HTTPS GeekBI endpoint. 2. If endpoint overrides are required for testing, place them behind an explicit development-only option that is disabled by default. 3. Parse the destination with `urllib.parse.urlsplit` and enforce: - `scheme == "https"` - An exact allowlist of approved hostnames - Approved ports only - No username or password component - No malformed or ambiguous hostname representation 4. Independently validate both the API base URL and every server-provided `jumpUrl`. 5. Restrict authorization URLs to approved HTTPS origins before displaying them to users. 6. Prevent sensitive headers from being forwarded across origins during redirects, or disable redirects and validate each redirect destination explicitly. 7. Bind persisted tokens to a normalized, validated origin rather than an unvalidated string. 8. Add tests proving that HTTP URLs, unknown hosts, embedded credentials, unusual ports, and cross-origin authorization URLs are rejected. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/geekbi_auth.py:68
Finding
Bearer tokens and device authorization state are unnecessarily replicated across multiple filesystem locations<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/geekbi_auth.py:68-87` - `scripts/geekbi_auth.py:369-383` - `scripts/geekbi_auth.py:637-650` **Vulnerability Type**: Excessive plaintext credential storage and credential duplication **Risk Level**: Medium ### Vulnerable Code From `scripts/geekbi_auth.py:68-87`: ```python def _user_config_state_path(): return _absolute_path( user_config_path("GeekBI", appauthor=False, ensure_exists=True) / "temu-research-skill" / AUTH_FILE_NAME ) def _skill_state_path(): return _absolute_path(Path(__file__).parent.parent / AUTH_STATE_DIR / AUTH_FILE_NAME) def _workspace_state_path(): return _absolute_path(Path(os.getcwd()) / AUTH_STATE_DIR / AUTH_FILE_NAME) def _resolve_stores(): candidates = ( ResolvedStore(_user_config_state_path(), "user-config-directory"), ResolvedStore(_skill_state_path(), "skill-directory"), ResolvedStore(_workspace_state_path(), "working-directory"), ) ``` From `scripts/geekbi_auth.py:369-383`: ```python def _write_state_files(stores, payload): normalized = _normalize_state(payload) errors = [] written = 0 for store in stores: try: _write_state_file(store, normalized) written += 1 except OSError as error: errors.append(f"{store.kind}: {_storage_probe_reason(error)}") if written == 0: reason = ";".join(errors) or "登录状态目录不可用" raise OSError(reason) ``` From `scripts/geekbi_auth.py:637-650`: ```python def save_token(latest): latest_server = latest["servers"].get(server_key) if not isinstance(latest_server, dict): return False, False latest_pending = latest_server.get("pending") if not isinstance(latest_pending, dict): return False, False if latest_pending.get("deviceCode") != pending.get("deviceCode"): return False, False _remove_access_token(latest_server) latest_server["a ...[truncated 3075 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Store authentication state in exactly one user-specific location. 2. Prefer an operating-system credential manager or keychain for bearer tokens. 3. Do not write access tokens or device codes into: - The current working directory - The installed Skill directory - Source-controlled project trees 4. Retain atomic file replacement and locking for non-secret metadata, but minimize the stored authentication fields. 5. Correct the unrelated `temu-research-skill` path component and use a Skill-specific GeekBI AliExpress namespace. 6. Implement a safe migration procedure: - Read legacy locations once - Select the newest valid state - Move it to the secure canonical store - Securely remove obsolete copies where supported 7. Apply restrictive platform-native ACLs on Windows and other non-POSIX systems instead of silently skipping permission hardening. 8. Consider storing only a refreshable opaque credential and avoid persisting pending device codes unless continuity across processes is essential. 9. Add token revocation support and clear all legacy copies during logout. 10. Document the credential location, retention period, and cleanup behavior for users and administrators. ]]>
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill instructs the agent to execute local scripts and read reference files, which implies shell, file-read, and likely network capabilities, but no permissions are declared. This creates a trust and containment gap: a caller or platform may not realize the skill can execute code and access external data, increasing the risk of unintended command execution, data access, or network egress if the surrounding runtime is permissive.

Static analysis

No suspicious patterns detected.