Back to skill

Security audit

Jungle Scout-关键词声量份额

Security checks for vulnerabilities and agentic risk

Overview

This skill performs the advertised Amazon keyword Share of Voice analysis, but it also handles account login, API-key creation, billing orders, local data retention, and silent feedback reporting in ways users should review carefully before installing.

Install only if you are comfortable with LinkFox account onboarding and billing actions being available inside this analytics skill. Prefer creating and managing API keys through the official LinkFox site, avoid storing secrets permanently in shell startup files when possible, confirm any paid SOV or package-order action before it runs, and do not use this skill in environments where untrusted variables can set LINKFOX_* endpoint URLs or SESSION_ID.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/junglescout_keyword_sov.py:37
Finding

Environment-controlled API endpoints can exfiltrate credentials and authentication data

Content
View full analysis
str: """Gateway base address: environment override first, production fallback.""" return (os.environ.get("LINKFOX_TOOL_GATEWAY") or "https://tool-gateway.linkfox.com").rstrip("/") ``` ```python # scripts/junglescout_keyword_sov.py:60-80 def call_api(params): api_url = get_api_url() api_key = get_api_key() data = json.dumps(params).encode("utf-8") headers = { "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/2.0", "SESSION_ID": os.environ.get("SESSION_ID", ""), "MESSAGE_ID": os.environ.get("MESSAGE_ID", ""), "MODE_ID": os.environ.get("MODE_ID", ""), "APP_NAME": os.environ.get("APP_NAME", ""), } req = Request(api_url, data=data, headers=headers, method="POST") with urlopen(req, timeout=150) as response: return json.loads(response.read().decode("utf-8")) ``` ```python # scripts/onboarding.py:71-85 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") ``` ```python # scripts/onboarding.py:190-203 ...[truncated 2994 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:209
Finding

Skill instructions direct silent disclosure of conversation-derived feedback

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/junglescout_keyword_sov.py:236
Finding

Unsanitized SESSION_ID permits path traversal and writes outside the intended session directory

Content
View full analysis
str: """Prefer env SESSION_ID; otherwise generate an identifier.""" 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]: 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) ``` ```python # scripts/junglescout_keyword_sov.py:319-341 serialized = json.dumps(result, ensure_ascii=False, indent=2) ts = int(time.time()) out_path = _resolve_output_path(ts) try: with open(out_path, "w") as f: f.write(serialized) print(f"Saved full response: {out_path} ({len(serialized)} bytes)") except OSError as e: print(f"Failed to save to {out_path}: {e}", file=sys.stderr) ``` ```python # scripts/onboarding.py:146-151 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 trusted directory name even though it comes from the process environment. No validation rejects absolute paths ...[truncated 1487 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:484
Finding

Generated long-lived API key is emitted in plaintext to standard output

Content
View full analysis
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} Successfully obtained API key " f"(source: {r['source']})", file=sys.stderr ) return 0 return 1 ``` ### Technical Analysis The onboarding flow returns the complete generated API key in a result dictionary and serializes that dictionary to standard output. Standard output is frequently captured by Agent contexts, terminal scrollback, CI logs, shell wrappers, telemetry, or orchestration systems. The key is intended for later use through an environment variable, which indicates that it is a reusable credential rather than a one-time secret. Printing the full value unnecessarily expands the number of systems and users capable of accessing it. ### Attack Path 1. A user completes SMS authentication through the onboarding command. 2. The script retrieves or generates a reusable LinkFox API token. 3. `_cmd_login` passes the full result to `_emit`. 4. `_emit` writes the complete API key as JSON to ...[truncated 559 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:163
Finding

Onboarding instructions recommend unpinned runtime dependency installation

Content
View full analysis
dict: try: import qrcode except ImportError: err = ( "Missing qrcode dependency; please run: " "pip install qrcode pillow" ) print(f"{TAG} render_qr: {err}", file=sys.stderr) return { "png_path": None, "ascii_qr": None, "error": err } ``` ```python # scripts/onboarding.py:182-186 def _require_requests() -> None: if requests is None: raise RuntimeError( "Missing requests dependency; please run: " "pip install requests" ) ``` ### Technical Analysis The script tells users to install `qrcode`, `pillow`, and `requests` without exact versions, hashes, a lockfile, or an approved package index. These are legitimate package names, and the audit found no evidence that the project intentionally references typosquatted packages. Nevertheless, unconstrained runtime installation makes the executed dependency versions dependent on the current package registry state and local pip configuration. A compromised upstream release, dependency-confusion condition, malicious package index, or future incompatible version could introduce code execution when the imported package is loaded. ### Attack Path 1. The onboarding script runs in an environment missing one of the optional dependencies. 2. The script instructs the user to execute the displayed `pip install` command. 3. Pip resolves packages from the user's configured index without version or hash restrictions. 4. A compromised, substituted, or unexpectedly changed package is installed. 5. The package executes in the user's environment when imported or during installation. 6. Malicious pa ...[truncated 464 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 (28)

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

Critical
Category
Data Flow
Confidence
92% confidence
Finding

The request destination and several outbound headers are influenced by environment variables, especially LINKFOX_TOOL_GATEWAY and SESSION_ID/MESSAGE_ID/MODE_ID/APP_NAME. If an attacker can control the execution environment, the script can be redirected to an arbitrary host and will send the API key plus request data to that host, causing credential and data exfiltration via SSRF-like behavior.

Content

Scanner excerpt · scripts/junglescout_keyword_sov.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
96% confidence
Finding

The code 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 endpoints. If an attacker can influence the runtime environment, they can redirect authentication traffic to an attacker-controlled host and exfiltrate credentials and tokens.

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

The gateway URL is also derived from environment variables and used in urllib.request.urlopen with the Authorization header populated from the agent API key. A malicious environment configuration can redirect these authenticated requests to an attacker-controlled server, exposing the API key and enabling unauthorized account or billing actions.

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 declared purpose is keyword SOV analysis, but the referenced behavior includes account login, SMS verification, API key issuance, subscription/order handling, payment QR generation, and payment-status queries. Mixing analytics with authentication, billing, and account-management flows greatly expands the attack surface and can expose users to credential misuse, unwanted charges, or unauthorized account actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is keyword SOV analysis, but the referenced behavior includes account login, SMS verification, API key issuance, subscription/order handling, payment QR generation, and payment-status queries. Mixing analytics with authentication, billing, and account-management flows greatly expands the attack surface and can expose users to credential misuse, unwanted charges, or unauthorized account actions.

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

text
A brand with high `sponsoredWeightedSov` but low `organicWeightedSov` relies heavily on ads; this can inform competitive strategy.

## Display Rules

1. **Brand table**: Show the brands table sorted by `combinedWeightedSov` descending; highlight the **top 5 brands** for quick comprehension
2. **SOV as percentage**: Display SOV values as percentages (multiply by 100), e.g., 0.152 → 15.2%

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file documents authentication recovery, account registration, and billing workflows that are unrelated to a keyword Share of Voice analytics skill. This scope expansion increases the chance the skill will solicit credentials, phone numbers, or payment actions under the guise of analytics support, which creates an unnecessary trust and abuse surface.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions tell the agent to ask for a user's phone number and drive scripted registration when API access is missing, even though that is not required for keyword analytics. Collecting personal contact data in an unrelated skill can enable unauthorized account creation, privacy violations, and social-engineering style abuse if the agent is compromised or overreaches.

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

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation includes plan selection, payment method validation, order creation, and payment artifact display, none of which are necessary for a Share of Voice analysis skill. Embedding purchase flows in the skill broadens it into financial operations, creating risk of unauthorized charges, phishing-like behavior, and user confusion about what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file implements account onboarding, SMS login, API key retrieval, package listing, order creation, and payment QR generation, which are unrelated to the declared keyword Share of Voice analytics purpose. Such capability mismatch is dangerous because it expands the skill into credential collection and monetization flows that users would not reasonably expect from an analytics skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code can create orders and generate payment QR codes for WeChat and Alipay, directly enabling financial transactions from within a skill that is supposed to perform keyword analytics. In context, this is especially dangerous because it creates a path for unauthorized or deceptive charges under the guise of analytics functionality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares no explicit tool scope or allowed-tools boundary, yet the content clearly indicates access to environment variables, filesystem writes, and network/API calls. Without a declared permission model, an agent may invoke broader capabilities than users expect, increasing the chance of unintended data access or exfiltration.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are broad enough to activate on loosely defined requests about competition, brand analysis, or market structure, even when the user did not clearly request this specific paid/networked skill. Overbroad triggering can cause unnecessary external calls, data processing, and cost-incurring actions that do not match user intent.

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

}

text

## curl 示例

```bash
curl -X POST https://tool-gateway.linkfox.com/tool-jungle-scout/keywords/share-of-voice \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documentation adds a separate external Feedback API that is unrelated to the stated Share of Voice analysis function. This creates an unnecessary outbound data path that could cause user content or agent-generated summaries to be transmitted to a third-party service without a clear functional need or user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill asks users to provide a phone number for registration but gives no privacy notice, retention guidance, or explanation of how that personal data will be processed. That omission makes collection of personally identifiable information opaque and increases legal, compliance, and user-harm risk if the data is mishandled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guidance tells users to persist API keys in shell startup files, which stores credentials on disk and may expose them through backups, shared accounts, terminal history, or later file disclosure. While environment variables are common, recommending permanent storage without any warning or safer alternatives weakens credential hygiene.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script always persists full API responses, cache entries, and session metadata to local storage, which goes beyond a read-only analytics behavior and increases the risk of unintended data retention. If the response contains sensitive business data, identifiers, or tokens, that information remains on disk and may be accessible to other users, processes, backups, or later tasks.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module documentation promises that writing to /tmp is forbidden and that failure to write the current directory should error out, but the implementation silently falls back to home and temporary directories. This mismatch can defeat operator expectations and policy controls, causing sensitive outputs to be written to less trusted locations such as shared temp storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script writes the full API response to disk on every run before deciding what to print, without any explicit consent, warning, or sensitivity check at the write site. In this skill context, the response may contain competitive intelligence, keyword economics, and session-linked metadata, so automatic persistence unnecessarily expands exposure and retention risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language interface, help text, and login flow are fixed to Chinese, and the phone verification path is restricted to 11-digit numbers with area code +86. This enforces a specific language/locale behavior without offering the user a choice or documenting an opt-in region constraint.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The code transmits sensitive user and session data to external services, including phone numbers, SMS codes, tokens, and account metadata. External transmission is particularly concerning here because the skill's declared purpose is analytics, yet the file performs authentication and credential-handling operations that users may not expect.

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

The file performs SMS-based authentication, token exchange, team lookup, and API key generation even though the skill is described as a keyword analytics tool. In this context, collecting login codes and minting API credentials is a major overreach that can facilitate credential theft, account takeover, or unauthorized API access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code retrieves or generates API tokens programmatically and returns them without any built-in user-facing warning, confirmation, or disclosure in this file. That omission increases the risk of users unknowingly creating long-lived credentials that can be mishandled, logged, or abused by surrounding automation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.