Back to skill

Security audit

西柚-关键词洞察

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does Amazon/Xiyou analytics, but it also handles credentials, phone login, purchases, silent feedback reporting, and persistent local storage in ways users should review carefully before installing.

Install only if you trust LinkFox/Xiyou with your ASINs, keywords, phone-login flow, API keys, and billing actions. Before use, confirm endpoint environment variables are not overridden, avoid storing secrets in shell profiles when possible, review or disable automatic feedback reporting, and be aware that full API responses may be saved locally without retention limits.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_xiyou_common.py:13
Finding

Credential Exfiltration Through Unrestricted Endpoint Overrides

Content
View full analysis
dict: client_id, client_secret = get_xiyou_credentials() payload = dict(params) payload["clientId"] = client_id payload["clientSecret"] = client_secret return payload def call_xiyou_api(route: str, params: dict) -> dict: api_key = get_linkfox_api_key() url = f"{GATEWAY_BASE}/{route.lstrip('/')}" body = json.dumps(merge_auth(params), ensure_ascii=False).encode("utf-8") req = Request( url, data=body, headers={ "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/1.0", }, method="POST", ) ``` The onboarding implementation has the same trust-boundary issue: ```python def _env_base(name: str, default: str, *fallbacks: str) -> str: for n in (name, *fallbacks): v = os.environ.get(n) if v: return v.rstrip("/") return default.rstrip("/") def _agent_base() -> str: return _env_base( "LINKFOX_AGENT_API_URL", "https://tool-gateway.linkfox.com", "LINKFOX_TOOL_GATEWAY", ) def _login_base() -> str: return _env_base("LINKFOX_LOGIN_API_URL", "https://api.linkfox.com") def _agent_user_base() -> str: return _env_base( "LINKFOX_AGENT_USER_API_URL", "https://agent-api.linkfox.com", ) ``` ### Technical Analysis The primary analytics client retrieves the following reusable credentials from environment variables: - LinkFox API key - Xiyou client ID - Xiyou client secret It then trans ...[truncated 2376 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:183
Finding

Silent External Feedback Reporting Can Disclose User Intent and Results

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_xiyou_common.py:112
Finding

Complete Analytics Responses Are Persisted With Default Permissions and Unexpected Fallback Locations

Content
View full analysis
str: cached = _LF_SESSION_CACHE.get("_root") if cached: return cached candidates = [] acpx = (os.environ.get("ACPX_WORKSPACES") or "").strip() if acpx: acpx = acpx.split(os.pathsep)[0].strip() if acpx: candidates.append(os.path.join(acpx, "linkfox")) candidates.append(os.path.join(os.getcwd(), "linkfox")) candidates.append(os.path.join(os.path.expanduser("~"), "linkfox")) candidates.append(os.path.join(_lf_tempfile.gettempdir(), "linkfox")) for root in candidates: try: os.makedirs(root, exist_ok=True) probe = os.path.join(root, ".write_probe") with open(probe, "w", encoding="utf-8") as f: f.write("") os.remove(probe) except OSError: continue root = os.path.abspath(root) _LF_SESSION_CACHE["_root"] = root return root ``` ```python def _lf_ensure_meta( root: str, session_dir: str, date_str: str, sid: str, ts: float, ) -> None: meta_path = os.path.join(session_dir, "_meta.json") if os.path.exists(meta_path): return meta = { "session_id": sid, "date": date_str, "started_at": _lf_iso(ts), "skills_called": [], "deliverables": [], "data_files": [], "media_files": [], } with open(meta_path, "w", encoding="utf-8") as f: json.dump(meta, f, ensure_ascii=False, indent=2) ``` ```python def emit_result(result, slug=SLUG, inline=False): serialized = json.dumps(result, ensure_ascii=False, indent=2) ts = _lf_time.time() date_str = _lf_time.strftime("%Y-%m-%d", _lf_time.localtime(ts)) ...[truncated 2572 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
scripts/onboarding.py:160
Finding

Onboarding Recommends Unpinned Runtime Dependency Installation

Content
View full analysis
dict: try: import qrcode except ImportError: err = "缺少 qrcode 依赖,请运行: pip install qrcode pillow" print(f"{TAG} render_qr: {err}", file=sys.stderr) return {"png_path": None, "ascii_qr": None, "error": err} ``` ```python def _require_requests() -> None: if requests is None: raise RuntimeError("缺少 requests 依赖,请运行: pip install requests") ``` ### Technical Analysis When dependencies are missing, the script instructs users to install `qrcode`, `pillow`, and `requests` directly from the configured Python package index without: - Version pins - Hash verification - A lock file - A reviewed constraints file - An isolated environment requirement The package names appear legitimate and there is no evidence that the Skill intentionally references a malicious or typosquatted package. Nevertheless, installing whatever version is current at execution time creates a non-reproducible supply-chain dependency. The resulting security posture depends on the user's configured package index, resolver behavior, and the future integrity of those packages and their transitive dependencies. ### Attack Path 1. The user invokes an onboarding feature that requires a missing package. 2. The script displays an unpinned `pip install` command. 3. The user runs that command in the active environment. 4. Pip resolves packages from the configured package index. 5. A compromised package release, malicious mirror, or unsafe transitive dependency executes installation or runtime code in the user's environment. ### Impact Assessment Any privileges obtained would be those of the user running `pip` or the later Python process. In a virtual environment, impact is generally limited to that ...[truncated 304 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (27)

Tainted flow: 'req' from os.environ.get (line 70, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/_xiyou_common.py (reported line 81)May include surrounding context.

python
method="POST",
    )
    try:
        with urlopen(req, timeout=TIMEOUT_SEC) as response:
            return json.loads(response.read().decode("utf-8"))
    except HTTPError as e:
        detail = e.read().decode("utf-8") if e.fp else ""

Tainted flow: 'url' from os.environ.get (line 235, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The script builds request destinations 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 derived API keys to those endpoints. In a hostile or misconfigured runtime, an attacker can redirect these requests to attacker-controlled servers and exfiltrate credentials or onboarding data without further validation.

Content

Scanner excerpt · scripts/onboarding.py (reported line 196)May include surrounding context.

python
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 = ""

Tainted flow: 'req' from os.environ.get (line 244, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The gateway URL is also environment-configurable, and the code sends the Authorization header containing the LinkFox API key to whatever host _agent_base() resolves to. If an attacker can influence environment variables, they can redirect authenticated gateway traffic and steal API keys or manipulate commerce/account operations such as package lookup, order creation, and order queries.

Content

Scanner excerpt · scripts/onboarding.py (reported line 246)May include surrounding context.

python
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

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is Xiyou analytics, but the detected behavior includes account login, SMS verification, API key management, package listing, order creation, payment initiation, QR generation, and payment-status queries. That is a serious scope expansion into authentication and financial workflows, which can enable credential abuse, social engineering, unwanted purchases, or sensitive account operations under the guise of a research skill.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · SKILL.md (reported line 151)May include surrounding context.

{"entities": [{"country": "US", "asin": "B06XZTZ7GB"}, {"country": "US", "asin": "B0XXXXXXXX"}]}

text

## Display Rules

1. 列表类结果优先表格展示:关键词/ASIN、流量、排名、占比等核心字段
2. 趋势类结果建议时间序列展示,标注峰值与变化方向

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/onboarding.md (reported line 14)May include surrounding context.

md
证码后:`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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents use of environment variables, network access, and local file writes, but it declares no explicit tool scope or allowed-tools boundary. That increases the blast radius if the skill is invoked in a broader agent runtime, because the agent may exercise capabilities users did not clearly consent to or that reviewers cannot easily constrain.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger conditions are broad enough to activate on generic Amazon ASIN and keyword-analysis requests even when the user did not ask for Xiyou specifically. Over-broad activation can route unrelated requests through this third-party service, causing unintended data disclosure, extra cost, or use of a tool the user did not intend to invoke.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation says full API responses are automatically written to the working directory, but it does not clearly warn users that their query inputs and returned business data will persist locally. Persistent storage of marketplace research, identifiers, and possibly account-related metadata increases the risk of unintended retention, later disclosure, or inclusion in source control and backups.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Automatically logging full API responses to persistent storage exceeds what is necessary for many user interactions and may capture sensitive commercial data, identifiers, quota information, or account details. Because the path is inside the project working directory, the data may be exposed to other tools, collaborators, backups, or accidental commits.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill states both that it does not consume points and that it may consume a large number of points dynamically and must warn the user. Contradictory billing language can mislead users into triggering paid actions without informed consent, especially when the skill is capable of repeated API lookups and the platform appears to have quota or package semantics.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file instructs users to send authentication material via headers and request bodies and states that secrets are auto-injected from environment variables before forwarding requests to an upstream service. While the API mechanics are documented, there is no explicit warning that credentials and query data will be transmitted to external services, which is the type of privacy/system-impact disclosure required for markdown files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file documents a separate feedback-submission API that is unrelated to the advertised ASIN/keyword analytics capability. Adding an extra outbound endpoint increases the skill's scope and creates a path for unsolicited data exfiltration, especially because the suggested payload includes free-form content that could contain user prompts, results, or other sensitive context. In a skill expected to perform analytics only, this hidden secondary channel is more dangerous because users and reviewers may not expect any data to be sent anywhere except the analytics gateway.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The onboarding guidance instructs collecting and processing a user's phone number for script-based registration, but it provides no privacy notice, consent language, retention limits, or handling restrictions. In a skill context, this creates unnecessary exposure of sensitive personal data and increases the risk of improper collection, logging, or transmission through the agent or host environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document tells users to persist API keys into shell startup files or system environment settings without warning that this modifies login profiles and stores credentials in locations that may be readable by other tools, users, backups, or support artifacts. While common operationally, instructing permanent credential storage without safer alternatives or disclosure increases the chance of credential leakage and unintended reuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

merge_auth injects XIYOU_CLIENT_ID and XIYOU_CLIENT_SECRET into the request body, and call_xiyou_api transmits that body to a remote gateway via HTTP POST. The code performs a sensitive network transmission of credentials, but there is no confirmation prompt or user-warning comment/docstring near the operation explaining that credentials are forwarded to the gateway.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The shared helper persistently writes full API responses to local disk under predictable session directories, even though the skill's stated role is API querying and analysis. These responses may contain sensitive commercial data, query history, or credential-adjacent metadata, creating unnecessary data retention and local exposure if the host is shared, backed up, or later compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The helper writes complete API responses to disk and only prints a save path/summary, without any user-facing warning or consent mechanism. In the context of an analytics skill handling ASIN and keyword intelligence, silent persistence increases privacy and data-governance risk because business-sensitive outputs may be retained beyond the user's expectation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This onboarding script performs account login, API key retrieval, plan listing, ordering, and payment QR generation, which materially exceeds the stated ASIN/keyword analytics purpose of the skill. Expanding a skill's capabilities into identity and commerce operations increases attack surface and creates opportunities for credential handling mistakes, unauthorized purchases, and user confusion about what the skill is permitted to do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains user-facing natural language exclusively in Chinese and the login flow is tied to a China-specific phone format and +86 area code. Under the policy for natural-language violations, forcing a specific language or locale without user opt-in should be flagged unless clearly documented as a justified region-specific tool, which is not stated here.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/onboarding.py (reported line 196)May include surrounding context.

python
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 = ""

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code contains direct subscription purchase and payment QR generation logic despite the skill being described as an analytics integration. Even if intended for convenience, embedding purchase flows in a skill increases the risk of social engineering, accidental charges, and abuse if the environment or upstream endpoints are tampered with.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This script sends user-supplied parameters to a remote LinkFox/Xiyou API via call_xiyou_api(route, params) without any visible disclosure, confirmation, or minimization at the call site. In a skill that processes ASINs, keywords, and possibly business research inputs, silent transmission can expose user-provided market intelligence or sensitive operational data to third-party services without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The user-visible status and setup instructions are presented only in Chinese, and the file does not indicate that language is selectable or optional. This can violate language or locale policy when users are not given an opt-in choice for a specific language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

These error/setup messages are natural-language strings shown to users and are restricted to Chinese without any documented locale choice. Because the file does not justify a Chinese-only constraint or offer opt-in language selection, this is a policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.