T01 · Skill Instruction Hijacking
- Location
skills/linkfox-zhihuiya-description-data-translated/SKILL.md:116- Finding
Automatic Feedback Instructions Can Disclose User Conversation Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its IP-search/report purpose, but it needs Review because it can send conversation feedback and credentials/account data over configurable network endpoints while also storing full results locally.
Install only if you are comfortable sending ASINs, product images, patent queries, generated prompts, and possible feedback text to LinkFox services. Use a clean environment with no custom LINKFOX_* gateway URLs unless you control them, treat LINKFOX_AGENT_API_KEY as a secret, avoid running in shared or synced workspaces, and do not upload private files or images unless they can be publicly accessible.
skills/linkfox-zhihuiya-description-data-translated/SKILL.md:116Automatic Feedback Instructions Can Disclose User Conversation Content
skills/linkfox-zhihuiya-description-data-translated/scripts/zhihuiya_description_translated.py:37Environment-Overrideable API Destinations Can Exfiltrate Credentials
skills/linkfox-aigc-textgen/scripts/onboarding.py:468Onboarding Prints Newly Generated API Keys to Standard Output
skills/linkfox-zhihuiya-description-data-translated/scripts/zhihuiya_description_translated.py:88Complete API Responses Are Persisted in Cleartext with Unsafe Default File Handling
The function downloads attacker-controlled URLs over arbitrary HTTP(S) and writes the response to disk without host allowlisting, content validation, or SSRF protections. In an agent environment, this can be abused to make outbound requests to internal services or fetch untrusted payloads, which is broader and riskier than the skill’s stated IP-search/reporting purpose.
req = Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
try:
with urlopen(req, timeout=timeout) as resp:
# 从 Content-Type 进一步修正扩展名
if guessed_ext == "bin":
ct = resp.headers.get("Content-Type", "")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
req = _lf_Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
try:
with _lf_urlopen(req, timeout=timeout) as resp:
if guessed_ext == "bin":
ct = resp.headers.get("Content-Type", "")
if "mp4" in ct:
The script sends API keys and multiple environment-derived metadata headers (SESSION_ID, MESSAGE_ID, MODE_ID, APP_NAME) to a network endpoint whose base URL can be overridden by the LINKFOX_TOOL_GATEWAY environment variable. If that variable is manipulated, requests and credentials can be redirected to an attacker-controlled server, causing secret exfiltration and leakage of workflow metadata.
}
req = Request(url, data=data, headers=headers, method="POST")
try:
with urlopen(req, timeout=HTTP_TIMEOUT) as response:
return json.loads(response.read().decode("utf-8"))
except HTTPError as e:
body = e.read().decode("utf-8") if e.fp else ""
The code builds destination URLs from environment variables such as LINKFOX_LOGIN_API_URL and LINKFOX_AGENT_USER_API_URL, then sends sensitive data including phone numbers, SMS codes, access tokens, refresh tokens, and generated API keys to those endpoints via requests.post. In a skill context, environment variables are part of the deployment trust boundary and may be attacker-controlled or misconfigured, enabling silent SSRF-like redirection and credential exfiltration to an arbitrary host.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway request path uses _agent_base() sourced from environment variables and then calls urlopen with the API key in the Authorization header. If the base URL is redirected to an attacker-controlled endpoint, the skill will transmit the LinkFox API key and business operations such as account/package/order requests to that host, causing credential leakage and unauthorized transaction flow.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The script builds request destinations from environment variables such as LINKFOX_LOGIN_API_URL and LINKFOX_AGENT_USER_API_URL, then sends phone numbers, SMS codes, access tokens, refresh tokens, and token-generation requests to those URLs. If an attacker can influence the environment, they can redirect these highly sensitive authentication flows to an attacker-controlled server and capture credentials or API keys.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway URL is also environment-controlled and is used for authenticated API calls with the API key placed in the Authorization header. An attacker who can set LINKFOX_AGENT_API_URL or related variables can redirect requests and exfiltrate the API key or manipulate package/order responses, leading to credential theft and fraudulent purchase flow abuse.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
download_media() accepts an arbitrary caller-supplied URL and fetches it with urlopen after only checking for http:// or https://. In an agent/runtime environment this creates a classic SSRF primitive that can be used to reach internal services, cloud metadata endpoints, or other unintended network locations, and the downloaded response is then persisted locally.
req = Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
try:
with urlopen(req, timeout=timeout) as resp:
# 从 Content-Type 进一步修正扩展名
if guessed_ext == "bin":
ct = resp.headers.get("Content-Type", "")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers={"Content-Type": "application/json", "Authorization": api_token},
)
try:
with urlopen(req, timeout=30) as resp:
body = json.loads(resp.read().decode())
break
except urllib.error.HTTPError as e:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers={"Content-Type": "application/json", "Authorization": api_token},
)
try:
with urlopen(req, timeout=30) as resp:
body = json.loads(resp.read().decode())
break
except urllib.error.HTTPError as e:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers={"Content-Type": "application/json", "Authorization": api_token},
)
try:
with urlopen(req, timeout=30) as resp:
body = json.loads(resp.read().decode())
break
except urllib.error.HTTPError as e:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
req = Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
try:
with urlopen(req, timeout=timeout) as resp:
# 从 Content-Type 进一步修正扩展名
if guessed_ext == "bin":
ct = resp.headers.get("Content-Type", "")
The code builds request destinations from environment-controlled base URLs and then sends sensitive authentication material to those endpoints via requests.post. If an attacker can influence environment variables such as LINKFOX_LOGIN_API_URL or LINKFOX_AGENT_USER_API_URL, they can redirect SMS-login tokens, refresh tokens, and API-token generation traffic to an attacker-controlled server, causing credential exfiltration and account takeover.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway client uses environment-derived base URLs to construct Request objects passed to urlopen while attaching the API key in the Authorization header. An attacker who can set LINKFOX_AGENT_API_URL or related variables can redirect traffic and capture the API key or manipulate billing/order operations, leading to credential theft and unauthorized account actions.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The script builds request destinations from environment variables and then sends sensitive login material, SMS codes, access tokens, and API keys to those endpoints via requests.post. If an attacker can influence the environment or deployment configuration, they can redirect these calls to attacker-controlled servers and exfiltrate credentials; in this skill, that risk is amplified because onboarding explicitly handles account login and API token issuance.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway URL is derived from environment variables and used to construct urllib requests that carry the agent API key in the Authorization header. A malicious or compromised runtime can point this base URL at an attacker-controlled service, causing silent credential leakage and potentially exposing account, package, and order operations; because this script also supports billing and order creation, misuse can lead to both account compromise and fraudulent transactions.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The script allows service base URLs to be overridden by environment variables and then sends phone numbers, SMS codes, access tokens, refresh tokens, and generated API tokens to those URLs via requests.post. In a skill/onboarding context, that creates a strong SSRF/exfiltration path: a manipulated runtime environment can redirect credential-bearing traffic to attacker-controlled infrastructure without user visibility.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway request path uses an environment-derived base URL and sends Authorization headers containing the agent API key through urllib.request.urlopen. If an attacker can influence environment configuration, they can redirect authenticated API traffic and harvest API keys or capture order/account data, which is especially risky in an onboarding script handling credentials and billing flows.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The script performs an HTTP PUT of arbitrary local file contents to a presigned URL obtained from a remote service, then sets the object ACL to public-read. Because the upload target is fully determined by the returned presigned URL and there is no validation that it belongs to an expected storage domain, a compromised or misconfigured gateway could direct sensitive local content to an unintended external destination.
)
try:
with urlopen(req, timeout=120) as response:
if response.status not in (200, 201):
print(f"Upload failed with status: {response.status}", file=sys.stderr)
sys.exit(1)
The code builds request destinations from environment variables via _login_base() and _agent_user_base(), then sends sensitive data including phone numbers, SMS codes, access tokens, refresh tokens, and generated API keys to those URLs. In an agent or hosted environment where env vars can be influenced, this becomes an exfiltration channel or SSRF-style redirect of credentialed traffic to attacker-controlled infrastructure.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway URL is derived from environment variables and then passed into urllib Request/urlopen together with the Authorization header containing the LinkFox API key. If an attacker can alter LINKFOX_AGENT_API_URL or related variables, authenticated requests for account info, package data, and order actions can be redirected to a malicious server, leaking credentials and enabling unauthorized billing-related actions.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The code builds request destinations from environment-controlled base URLs and then sends sensitive data such as phone numbers, SMS codes, access tokens, refresh tokens, and generated API tokens to those endpoints. If an attacker can influence environment variables in the skill runtime, they can redirect authentication and credential traffic to attacker-controlled servers, causing credential theft and account compromise.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway request uses a URL assembled from environment-controlled configuration and sends the API key in the Authorization header via urlopen. A manipulated environment can exfiltrate the user's API key and redirect subsequent privileged account, package, and order operations to attacker infrastructure.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code
The code builds destination URLs from environment variables and then sends sensitive data such as phone numbers, SMS codes, access tokens, refresh tokens, and generated API tokens to those endpoints via requests.post. If an attacker can influence the process environment, they can redirect authentication traffic to attacker-controlled servers and exfiltrate credentials and tokens. The skill context increases risk because this file explicitly handles login and token issuance flows, so the transmitted data is highly sensitive.
except RuntimeError as e:
return {"_error": str(e)}
try:
r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
return r.json()
except Exception as e:
body_text = ""
The gateway helper constructs outbound requests using a base URL sourced from environment variables and includes the API key in the Authorization header. An attacker who can set LINKFOX_AGENT_API_URL or a fallback variable can redirect these requests to an attacker-controlled endpoint and capture the API key or manipulate package/order responses. This is especially dangerous here because the code also supports order creation and payment-related actions.
headers["Content-Type"] = "application/json"
req = Request(url, method=method, data=body_bytes, headers=headers)
try:
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
status = e.code