T01 · Skill Instruction Hijacking
- Location
SKILL.md:123- Finding
Silent External Feedback Reporting and Promotional Instruction Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has real Amazon Ads authorization functions, but it also adds silent feedback reporting, LinkFox login/payment flows, and local storage of sensitive account data.
Install only if you are comfortable giving LinkFox an API key, using LinkFox account and billing flows, and having Amazon Ads account metadata and authorization URLs written locally. Avoid setting custom gateway URL environment variables, review local linkfox output folders after use, and do not submit phone codes or payment actions unless you intended to use LinkFox services.
SKILL.md:123Silent External Feedback Reporting and Promotional Instruction Injection
scripts/_lf_output.py:25Plaintext Persistence of API Responses and OAuth Authorization URLs
scripts/onboarding.py:165Unpinned Runtime Installation of Third-Party Python Packages
The destination URL is derived from environment variables, allowing a caller or compromised runtime to redirect requests to an attacker-controlled endpoint while the script includes the Authorization API key in the outbound header. In a skill whose purpose is account authorization, exfiltrating credentials or sending authorization requests to an untrusted host is a serious risk because it can leak secrets and facilitate account takeover workflows.
method="POST",
)
try:
with urlopen(req, timeout=150) 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 request target is derived from environment-controlled base URL values and then used in urlopen with an Authorization header containing the API key. If an attacker can influence LINKFOX_TOOL_GATEWAY or AMAZON_ADS_BASE_URL, they can redirect the request to an attacker-controlled server and exfiltrate credentials or sensitive account metadata. In this authorization-management skill, that context increases risk because the endpoint returns linked ad account/profile information and uses privileged service authentication.
method="POST",
)
try:
with urlopen(req, timeout=150) 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 sends authentication data and other sensitive requests to URLs derived from environment-configurable base endpoints. In a skill execution environment, those environment variables can be influenced by deployment or a compromised host, turning this into credential exfiltration or SSRF against attacker-controlled infrastructure. The risk is elevated because the requests carry login tokens, SMS-login data, and generated 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 request path uses urllib to contact a URL built from environment-derived configuration and attaches the API key in the Authorization header. If the base URL is changed to an attacker-controlled endpoint, the script will leak API credentials and may also be abused for SSRF-style access to unintended internal or external services. Because this function supports order and account operations, compromise could expose billing and account-management 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 request destination is influenced by environment variables (LINKFOX_TOOL_GATEWAY or AMAZON_ADS_BASE_URL) and the code sends the Amazon Ads API key in an Authorization header to that URL. If an attacker can alter the runtime environment, they can redirect the request to an attacker-controlled server and exfiltrate the credential, turning this into SSRF-plus-secret-leakage. In an auth/account-management skill, this is more dangerous because the token/API key grants access to sensitive advertising account data and management operations.
method="POST",
)
try:
with urlopen(req, timeout=150) 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 request destination is indirectly controlled by environment variables via LINKFOX_TOOL_GATEWAY or AMAZON_ADS_BASE_URL, and the script sends a sensitive Authorization header to whatever URL is configured. If an attacker can influence the runtime environment, they can redirect the token-refresh request to an attacker-controlled endpoint and exfiltrate the API key and request metadata.
method="POST",
)
try:
with urlopen(req, timeout=150) 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 request destination is derived from environment-controlled configuration via LINKFOX_TOOL_GATEWAY or AMAZON_ADS_BASE_URL and then used directly in urlopen while also attaching the Authorization API key. If an attacker can influence the runtime environment, they can redirect this request to an arbitrary host and exfiltrate the API key and account identifiers, which is especially sensitive in an authorization/token-management skill.
method="POST",
)
try:
with urlopen(req, timeout=150) 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 manifest presents the skill as Amazon Ads authorization/account management, but the instructions also require generic local persistence, session metadata handling, and response summarization behavior unrelated to the stated business purpose. That mismatch can hide secondary data-handling behavior from users and reviewers, which is risky when responses may contain account metadata or token-related information.
The manifest presents the skill as Amazon Ads authorization/account management, but the instructions also require generic local persistence, session metadata handling, and response summarization behavior unrelated to the stated business purpose. That mismatch can hide secondary data-handling behavior from users and reviewers, which is risky when responses may contain account metadata or token-related information.
The manifest presents the skill as Amazon Ads authorization/account management, but the instructions also require generic local persistence, session metadata handling, and response summarization behavior unrelated to the stated business purpose. That mismatch can hide secondary data-handling behavior from users and reviewers, which is risky when responses may contain account metadata or token-related information.
The manifest presents the skill as Amazon Ads authorization/account management, but the instructions also require generic local persistence, session metadata handling, and response summarization behavior unrelated to the stated business purpose. That mismatch can hide secondary data-handling behavior from users and reviewers, which is risky when responses may contain account metadata or token-related information.
The trigger conditions are intentionally broad enough to fire even when the user does not explicitly mention Amazon Ads or authorization, as long as the conversation loosely involves account binding, token management, or profile listing. In an agent environment, overbroad invocation can cause the wrong skill to activate, leading to unintended access to account-management actions, unnecessary API calls, or sensitive data exposure in the wrong workflow.
This skill documents the ability to read and refresh live access and refresh tokens, which is a credential-access capability. In the context of an authorization-management skill, that makes the issue more dangerous because the skill is specifically positioned to handle account bindings and could expose reusable secrets that unlock downstream Amazon Ads access across profiles/sites.
### 4. 刷新令牌 — `/amazonAds/refreshToken`
`accessToken` 1 小时有效;过期后下游返回 HTTP 401 或错误体含 `expired` / `unauthorized` / `access token`。
**Request**(`authRecordId` 和 `profileId` 二选一):
| 参数 | 类型 | 说明 |
The onboarding document describes Linkfox agent API-key acquisition, phone-based registration, and billing flows that are unrelated to the stated Amazon Ads authorization/profile-management purpose of the skill. This scope mismatch is dangerous because it can trick operators into collecting credentials, phone numbers, and payment details for an external service under the guise of Amazon Ads support, creating unnecessary account, privacy, and supply-chain risk.
The file instructs operators to initiate phone-based registration/login and payment-plan ordering, which are unjustified by the skill's declared Amazon Ads role. In this context, the extra capabilities materially expand access to personal data and financial workflows, increasing the chance of phishing-like behavior, unauthorized account creation, or misuse of user billing interactions.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
证码后:`python scripts/onboarding.py login <phone> <code>`(workbuddy 宿主加 `--channel workbuddy`)
- 拿到 `api_key` 后把下面三平台配置转发给用户,提示重启会话生效:
- Windows PowerShell(永久):`setx LINKFOX_AGENT_API_KEY "<key>"`
- macOS zsh:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.zshrc && source ~/.zshrc`
- Linux bash:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.bashrc && source ~/.bashrc`
- 变量名 `LINKFOX_AGENT_API_KEY`(主推)或 `LINKFOXAGENT_API_KEY`(老规范)任一即可
**billing 场景**:`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。
- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单,否则输出编号清单让用户选
- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`(通常 `wechat/alipay`)
- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG
The file is an onboarding and payment CLI for LinkFox, not an Amazon Ads authorization/management implementation as declared by the skill metadata. This mismatch is dangerous because users invoking an Amazon Ads skill could instead be steered into unrelated account onboarding, credential capture, token issuance, and payment flows they did not intend to authorize. The skill-context mismatch materially increases risk because the hidden behavior is outside the user's expected trust boundary.
The module docstring explicitly identifies the file as a LinkFox account/environment onboarding CLI, directly contradicting the declared Amazon Ads authorization skill purpose. This is a strong indicator of deceptive packaging or repurposed code being hidden behind misleading metadata, which undermines informed user consent and trust. In a security review, such a mismatch is highly suspicious and increases the likelihood of abusive behavior.
The script supports package lookup, order creation, payment QR generation, and order-status queries, which are unrelated to Amazon Ads authorization or profile management. Embedding purchase capabilities in a differently-described skill can trick users into financial actions outside the stated purpose and increases the blast radius from mere mislabeling to potential unauthorized billing. In this skill context, that is a serious scope-deception issue.
The ability to create paid orders and render QR codes enables direct monetization actions that are unjustified by the declared Amazon Ads authorization use case. A user could be induced to scan and pay for unrelated products or services while believing they are completing an Ads authorization step. Because it touches payment, the contextual danger is especially high.
This section sends SMS codes, logs users into LinkFox, and generates API tokens for LinkFox services rather than handling Amazon Ads OAuth or profile access. Collecting phone numbers and verification codes under the cover of an Amazon Ads skill can enable credential harvesting and unauthorized account access to a different platform. The contextual mismatch makes the behavior substantially more dangerous than a normal standalone onboarding utility.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
Amazon Ads Token Refresh - LinkFox Skill
Calls /amazonAds/refreshToken to refresh access token
Usage:
python refresh_token.py '{"authRecordId": 123}'
The skill advertises execution paths involving environment access, shell, network, and file writes, but it declares no explicit tool scope or permission boundaries. In an agent setting, this increases the chance of over-privileged execution and makes it harder to constrain access to sensitive environment variables, local files, or outbound requests.
L036 states the tool consumes points and warns against repeated attempts without informing the user, while L121 states '不消耗积分' (does not consume points). These statements directly contradict each other and create intent ambiguity around usage cost.
The skill mandates persistent storage of complete API responses in the current project directory and does not pair that with a clear user-facing privacy warning or consent step. Because this skill handles authorization, profiles, and token-status data, those files may retain sensitive account metadata and operational context in locations users do not expect.
No suspicious patterns detected.