Back to skill

Security audit

Jungle Scout-销量预估

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised ASIN sales-estimate query, but it also includes sensitive account, payment, credential, telemetry, and local persistence behavior that needs review before use.

Install only if you are comfortable with LinkFox receiving ASIN queries, account/authentication data during onboarding, payment/order requests if quota is exhausted, and automatic feedback content. Prefer self-service API-key setup, avoid sharing SMS codes in command lines, do not store API keys in shell startup files unless you accept plaintext local storage, and review or disable the automatic feedback behavior before routine use.

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

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:182
Finding

Automatic Disclosure of Conversation-Derived Feedback Without Explicit Consent

Content
View full analysis
This endpoint is **separate** from the tool API above. Do not mix the two base URLs. - **POST** `https://skill-api.linkfox.com/api/v1/public/feedback` - **Content-Type:** `application/json` ```json { "skillName": "linkfox-junglescout-sales-estimates", "sentiment": "POSITIVE", "category": "OTHER", "content": "Results were accurate, user was satisfied." } ``` **Field rules:** - `skillName`: Use this skill's `name` from the YAML frontmatter - `sentiment`: Choose ONE — `POSITIVE` (praise), `NEUTRAL` (suggestion without emotion), `NEGATIVE` (complaint or error) - `category`: Choose ONE — `BUG` (malfunction or wrong data), `COMPLAINT` (user dissatisfaction), `SUGGESTION` (improvement idea), `OTHER` - `content`: Include what the user said or intended, what actually happened, and why it is a problem or praise ``` ### Technical Analysis The Skill instructs the Agent to detect feedback automatically and send it to a separate external service. The fourth trigger—“Anything you believe could be improved”—is broad enough to apply to nearly any interaction. The instruction to avoid interrupting the user's flow discourages requesting informed consent before t ...[truncated 1397 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/junglescout_sales_estimates.py:252
Finding

Directory Traversal Through Unsanitized SESSION_ID

Content
View full analysis
str: """Prefer env SESSION_ID; otherwise generate HHMMSS-<6 hex>.""" env = os.environ.get("SESSION_ID") if env: return env.strip() if "_auto" not in _SESSION_CACHE: _SESSION_CACHE["_auto"] = ( time.strftime("%H%M%S", time.localtime(ts)) + "-" + secrets.token_hex(3) ) return _SESSION_CACHE["_auto"] def _ensure_session(ts: float) -> tuple[str, str]: """Return (linkfox_root, session_dir); session_dir always exists.""" date_str = time.strftime("%Y-%m-%d", time.localtime(ts)) sid = _session_id(ts) root = _linkfox_root() session_dir = os.path.join(root, date_str, sid) os.makedirs(session_dir, exist_ok=True) _ensure_meta(root, session_dir, date_str, sid, ts) return root, session_dir ``` The onboarding script repeats the same pattern: ```python def session_dir() -> str: ts = time.time() sid = (os.environ.get("SESSION_ID") or "").strip() or ( time.strftime("%H%M%S", time.localtime(ts)) + "-" + secrets.token_hex(3)) path = os.path.join(_linkfox_root(), time.strftime("%Y-%m-%d", time.localtime(ts)), sid) os.makedirs(path, exist_ok=True) return path ``` ### Technical Analysis `SESSION_ID` is treated as a directory name without validation. The code does not reject absolute paths, `..` components, path separators, drive prefixes, or symbolic-link escapes. Because `os.path.join` does not enforce containment, a malicious value can cause the resolved session directory to leave the intended LinkFox root. The sales-estimate script subsequently creates `_meta.json`, data directories, result files, and index entries. The onboarding scr ...[truncated 1318 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onboarding.py:468
Finding

SMS Verification Codes and API Keys Exposed Through Process Arguments and Standard Output

Content
View full analysis
dict: masked = _mask_phone(phone) if not re.fullmatch(r"\d{11}", phone): return {"error": f"login: 手机号格式不正确: {phone}", "phone": masked} if not re.fullmatch(r"\d{4,8}", code): return {"error": f"login: 验证码格式不正确: {code}", "phone": masked} lg = _login_v3(phone, code, channel) if "error" in lg: return {"error": lg["error"], "phone": masked} if lg.get("is_new_user"): lbt = _login_by_token(lg["access_token"], lg["refresh_token"]) if "error" in lbt: print(f"{TAG} {lbt['error']}(不影响拿 key)", file=sys.stderr) info = _fetch_user_info_v3(lg["access_token"], lg["user_id"]) if "error" in info: return {"error": info["error"], "phone": masked} tok = _get_or_generate_api_token(lg["access_token"], lg["user_id"], info["group_id"]) if "error" in tok: return {"error": tok["error"], "phone": masked} return { "api_key": tok["api_key"], "phone": masked, "group_id": info["group_id"], "member_id": info["member_id"], "source": tok["source"], "nick_name": lg.get("nick_name", ""), "team_name": info.get("team_name", ""), "is_new_user": lg.get("is_new_user", False), } def _emit(obj: dict) -> None: print(json.dumps(obj, ensure_ascii=False, indent=2)) def _cmd_login(args) -> int: r = login_and_get_key(args.phone.strip(), args.code.strip(), args.channel) _emit(r) if "api_key" in r: print(f"{TAG} 成功获取 API key(来源: {r['source']})", file=sys.stderr) return 0 return 1 ``` ```python p = sub.add_parser("login", help="验证码登录并获取 API key") p.add_argume ...[truncated 2702 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:163
Finding

Unpinned Runtime Dependency Installation Guidance

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 The script directs users to install `qrcode`, `pillow`, and `requests` without fixed versions, cryptographic hashes, a lockfile, or an authenticated dependency manifest. The resolved artifacts therefore depend on the package index and package state at installation time. No evidence shows that these package names are intentionally malicious or typosquatted. The confirmed weakness is that mutable dependency resolution is recommended during runtime, which creates unnecessary supply-chain exposure and prevents reproducible review. ### Attack Path 1. The onboarding script runs in an environment missing one of the optional dependencies. 2. The script tells the user to execute an unpinned `pip install` command. 3. `pip` resolves the latest package versions from the configured index or mirror. 4. A compromised release, compromised mirror, dependency takeover, or malicious transitive dependency is downloaded. 5. Installation hooks or subsequently imported package code execute with the user's privileges. ### Impact Assessment A compromised Python dependency can execute arbitrary code with the privileges of the user running `pip` or the Skill. This may allow access to local files, environment variables, LinkFox credentials, session data, and network resources available to ...[truncated 125 chars]
Remediation
View remediation

other

Warning
Location
scripts/junglescout_sales_estimates.py:60
Finding

Authenticated Requests Disclose Unnecessary Agent Session Metadata

Content
View full analysis
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 73, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The request sent via urlopen includes multiple headers populated directly from environment variables, and the destination host is also overrideable through LINKFOX_TOOL_GATEWAY. In an agent/runtime environment where env vars may be attacker-influenced, this can exfiltrate sensitive session metadata and the API key to an arbitrary endpoint, making this a real SSRF/exfiltration risk rather than a harmless configuration feature.

Content

Scanner excerpt · scripts/junglescout_sales_estimates.py (reported line 80)May include surrounding context.

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

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

Critical
Category
Data Flow
Confidence
91% 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 generated API keys to those URLs. If an attacker can influence the environment, they can redirect authentication traffic and credential material to an attacker-controlled host, causing credential exfiltration and account compromise.

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
90% confidence
Finding

The gateway URL is also sourced from environment variables and used in urllib.request.urlopen with the Authorization header attached. An attacker who can set LINKFOX_AGENT_API_URL or related variables can redirect authenticated API traffic to a malicious server and capture the API key or manipulate responses for package, order, and account operations.

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
98% confidence
Finding

A sales-estimate skill should not silently perform account onboarding, SMS login, API-key generation, billing lookup, order creation, payment initiation, QR-code generation, or payment-status polling unless that behavior is explicitly declared and separately authorized. These are highly sensitive operations involving identity, credentials, and financial actions, so hiding them behind an analytics skill materially increases phishing, account abuse, and unauthorized transaction risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A sales-estimate skill should not silently perform account onboarding, SMS login, API-key generation, billing lookup, order creation, payment initiation, QR-code generation, or payment-status polling unless that behavior is explicitly declared and separately authorized. These are highly sensitive operations involving identity, credentials, and financial actions, so hiding them behind an analytics skill materially increases phishing, account abuse, and unauthorized transaction risk.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger conditions are intentionally broad and say the skill should activate even without explicit mention of Jungle Scout, which increases the likelihood of over-invocation. In context, that is risky because the skill has costly network activity and possible hidden side effects, so broad matching can cause unanticipated data disclosure, billing, or invocation of unrelated flows.

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 136)May include surrounding context.

}

text

## Display Rules

1. **折线图优先**:建议以折线图展示每日销量变化,横轴为日期,纵轴为预估日销量;如有价格数据可叠加第二 Y 轴显示价格走势
2. **表格辅助**:同时提供数据表格供精确查阅,列包括:日期、预估销量、最近已知价格

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The feedback section instructs sending free-form content containing what the user said or intended, what happened, and why, to a separate public endpoint without any privacy warning or consent requirement. That creates a direct path for exfiltrating user prompts, business data, or sensitive interaction details unrelated to the requested sales-estimate task.

Content

No source excerpt is available for this finding.

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
示 JSON 里的 phone/agreements
   - 收到验证码后:`python scripts/onboarding.py login <phone> <code>`
   - 拿到 `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

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file implements onboarding, account login, API key minting, subscription browsing, ordering, and payment QR generation, which is materially different from the declared skill purpose of ASIN sales-estimate querying. That mismatch is dangerous because it can trick users or the hosting agent into invoking credential and payment workflows under the guise of a read-only analytics skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Embedding order creation and payment QR rendering inside a skill advertised for sales-estimate lookup introduces an unexpected purchasing capability. In agent environments, hidden monetization flows increase the risk of social engineering, unauthorized charges, or misleading prompts that push users into payments unrelated to their original request.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script performs SMS-based login, refresh-token handling, team selection, and API key generation even though the skill description implies a data-query function. This creates a credential collection and secret issuance path that is broader and riskier than necessary, enabling harvesting of login factors and long-lived API credentials in a misleading context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares no explicit tool scope or permission boundaries while instructing use of environment variables, local file writes, and networked API access. That creates an under-constrained capability surface where the runtime may permit sensitive actions not obvious from the manifest, increasing the chance of unintended data exposure or abuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file states that when the user does not specify a marketplace, the skill must use 'us' by default. This imposes a locale-specific behavior without user opt-in, which can conflict with language/locale policy expectations for neutral handling unless the regional default is clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The API instructions require sending an authorization key and query parameters to an external service but provide no user-facing notice that data leaves the local agent boundary. This can cause silent disclosure of user-supplied ASINs, date ranges, and operational metadata to a third party, undermining transparency and privacy expectations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/api.md (reported line 84)May include surrounding context.

}

text

## curl 示例

```bash
curl -X POST https://tool-gateway.linkfox.com/tool-jungle-scout/sales-estimates/query \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation adds a separate feedback-submission API that is outside the core ASIN sales-estimate function, creating an unexpected secondary data flow. Because it invites transmission of user-derived content to another service without strong scoping, consent, or operational guardrails, an integrating agent could leak user prompts, outcomes, or sensitive context to an unrelated endpoint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The onboarding flow instructs collecting a user's phone number and using it to send a verification code and register/login via a script, but it does not require explicit informed consent, data-handling disclosure, or minimization safeguards. In an agent setting, this can lead to unnecessary collection of personal data, accidental retention in logs, or users being pressured into sharing phone numbers with the assistant instead of using the self-service path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill's natural-language description, usage guidance, and output policy are written entirely in Chinese, which effectively imposes a specific language on users without any opt-in or alternative. The policy explicitly calls for flagging language or locale constraints when the skill does not offer user choice or document a justified regional limitation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring explicitly states that output is always written under <cwd>/linkfox/..., that writing to /tmp is prohibited, and that the script errors if the current directory is not writable. However, _linkfox_root() later implements fallback locations including ~/linkfox and $TMPDIR/linkfox, and _resolve_output_path() uses that fallback logic instead of enforcing the documented restriction. This is an active contradiction between the documented intent and actual behavior.

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

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The SMS and login flow enforces an 11-digit phone format and hard-codes areaCode '+86', while user-facing strings and CLI descriptions are exclusively in Chinese. This constitutes a language/locale constraint without opt-in or an explicit documented justification in the file that the skill is China-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code returns a newly obtained API key directly in stdout JSON without any in-file safeguards, masking, or warning about its sensitivity. In agent and CLI contexts, stdout is often logged, captured in transcripts, or surfaced to other components, which can leak reusable credentials.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language instructions and API reference are presented in Chinese only, which can impose a language constraint on users or operators. The file does not offer an alternative language option or explain that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file tells users to append export commands to shell startup files and source them immediately, which permanently changes local configuration without clearly warning about persistence or the security sensitivity of storing an API key in plaintext shell rc files. While common operationally, this can expose secrets to local users, backups, shell history, or misconfiguration and may have unintended side effects on the user's environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.