T09 · Insecure Skill Coding Practices
- Location
scripts/_temu_common.py:14- Finding
Environment-Controlled Gateway Override Can Exfiltrate LinkFox and Temu Credentials
- Content
View full analysis
dict: """调用 Temu 网关接口;必须先具备 LinkFox 用户 Token。""" linkfox_token = get_linkfox_token(linkfox_params) data = json.dumps(body, ensure_ascii=False).encode("utf-8") req = Request( url, data=data, headers=build_gateway_headers(linkfox_token), method="POST", ) try: with urlopen(req, timeout=timeout) as response: return json.loads(response.read().decode("utf-8")) ``` The proxy body containing the Temu credential is constructed as follows: ```python body = { "site": site, "managementType": management_type, "accessToken": resolve_access_token(params), "type": api_type, } biz = business if business is not None else extract_business_params(params) if biz: body["params"] = biz return body def us_proxy_call(params: dict, api_type: str, business=None, timeout: int = 150) -> dict: body = build_us_proxy_body(params, api_type, business) return call_temu_api(PROXY_URL, body, timeout=timeout, linkfox_params=params) ``` ### Technical Analysis The Skill declares `https://tool-gateway.linkfox.com` as its gateway, but three environment variables can replace that destination with an arbitrary URL. No scheme validation, hostname allowlist, port restriction, or explicit development-mode check is applied. A normal ...[truncated 1939 chars]- Remediation
View remediation
