Back to skill

Security audit

睿观-图片政策合规监测

Security checks for vulnerabilities and agentic risk

Overview

The skill does perform image compliance checks, but it also handles login, payments, public image uploads, saved response files, and silent feedback reporting in ways users should review carefully.

Install only if you trust LinkFox with product images, account setup, billing actions, and feedback data. Prefer already-public image URLs, avoid confidential local images, verify LINKFOX_* endpoint variables before use, do not submit phone/SMS/payment flows unless intended, and treat any printed API key or saved response file as sensitive.

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

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:135
Finding

Silent Transmission of User Feedback and Intent to a Third-Party Endpoint

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` ... - `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 perform a secondary network operation that is not necessary for image-compliance detection. The instruction explicitly requests information about what the user said or intended and directs the Agent not to interrupt the user's flow. The trigger is excessively broad, particularly “Anything you believe could be improved,” which allows telemetry to be generated during ordinary use. There is no requirement to obtain explicit consent, display the proposed payload, redact sensitive content, or limit the collected data to anonymous operational metrics. This changes the Agent's behavior whenever the Skill is loaded and creates an undisclosed data-externalization channel to a service separate from the compliance API. ### Attack Path 1. A user activates the Skill for an image-compliance request. 2. The user expresses satisfaction, dissatisfaction, intent, or informa ...[truncated 863 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ruiguan_image_compliance_search.py:37
Finding

Environment-Controlled Endpoints Can Receive Authentication Secrets and User Data

Content
View full analysis
str: """Gateway base address: env LINKFOX_TOOL_GATEWAY first, production fallback.""" return (os.environ.get("LINKFOX_TOOL_GATEWAY") or "https://tool-gateway.linkfox.com").rstrip("/") ``` The selected endpoint receives the API key and session metadata: ```python 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")) ``` From `scripts/upload_image.py`: ```python _API_BASE = (os.environ.get("LINKFOX_TOOL_GATEWAY") or "https://tool-gateway.linkfox.com").rstrip("/") PRESIGN_URL = f"{_API_BASE}/oss/file/presignedPut" ``` From `scripts/onboarding.py`: ```python 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") ``` The generic request function sends the supplied body and headers directly: ```python def _http_post(url: str, body: dict, headers: dict, timeout: int = 30) -> dict: try: _require_requests() except Run ...[truncated 2043 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/upload_image.py:89
Finding

Local Images Are Uploaded with Public-Read Access Without Enforced Expiration

Content
View full analysis
str: """Extract the base public URL by stripping query parameters.""" return presigned_url.split("?")[0] ``` ### Technical Analysis The upload request explicitly assigns the object a `public-read` ACL. The script then strips the presigned query parameters and returns the underlying object URL, indicating that anonymous access is expected. The documentation claims that the public URL is valid for 24 hours, but the script does not set an object expiration time, schedule deletion, or verify a server-side lifecycle policy. Expiration of a presigned PUT URL controls the upload authorization; it does not automatically revoke anonymous access to an object that was stored with a public-read ACL. Public upload is related to the declared need for a remotel ...[truncated 1067 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:384
Finding

API Keys and Potentially Token-Bearing Responses Are Printed in Plaintext

Content
View full analysis
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 (source: {r['source']})", file=sys.stderr) return 0 return 1 ``` ### Technical Analysis The login command intentionally emits the complete API key as JSON on standard output. Standard output may be captured by Agent transcripts, terminal logs, CI systems, process supervisors, or shell redirection. Error paths also serialize complete upstream response objects. If an unexpected response includes access tokens, refresh tokens, API tokens, personal account data, or internal identifiers, those fields are copied into the error message and printed. Mask ...[truncated 1044 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:163
Finding

Unpinned Runtime Dependency Installation Instructions

Content
View full analysis
dict: try: import qrcode except ImportError: err = "Missing qrcode dependency; run: 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("Missing requests dependency; run: pip install requests") ``` ### Technical Analysis The instructions direct users to install mutable package names without exact versions, hashes, a lockfile, or an explicitly trusted package index. The installed artifact can therefore vary over time and across environments. No evidence shows that the named packages are currently malicious. The vulnerability is the unsafe supply-chain practice: future package compromise, dependency confusion through a configured private index, or a malicious transitive dependency could introduce code that executes in the user's Python environment. ### Attack Path 1. The script runs in an environment where `requests`, `qrcode`, or `Pillow` is missing. 2. The script instructs the user to run an unpinned `pip install` command. 3. Pip resolves packages and transitive dependencies from the environment's configured indexes. 4. A compromised package version, malicious mirror, or dependency-confusion candidate is selected. 5. Package installation or later import executes attacker-controlled package code with the user's privileges. ### Impact Assessment A compromised dependency executes with the same operating-system privileges as the user running pip or the Skill. It could read project files and environment variables, including LinkFox credentials, or modify the Python environment. The ...[truncated 126 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ruiguan_image_compliance_search.py:235
Finding

Unsanitized Session Identifier Permits Filesystem Path Traversal

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 ``` From `scripts/onboarding.py`: ```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 inserted directly into a filesystem path without validation. A value containing `..` components can traverse out of the intended session directory. On supported platforms, an absolute path may also cause `os.path.join` to discard preceding components. The code does not canonicalize the result and verify that it remains beneath the selected LinkFox root. Subsequent operations write metadata, complete JSON responses, cache-re ...[truncated 1237 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ruiguan_image_compliance_search.py:104
Finding

Sensitive Responses Are Persisted with Permissive Defaults and May Fall Back to a Temporary Directory

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

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

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. In an agent/skill environment, environment variables are part of the deployment trust boundary; if they are tampered with, this becomes an exfiltration channel to attacker-controlled infrastructure.

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 request path uses a URL derived from environment-controlled base addresses together with the API key in the Authorization header. If the base URL is redirected to an attacker-controlled host, the skill will transmit bearer credentials and account/order data externally, enabling credential theft and account abuse.

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

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The request sent via urlopen includes multiple headers populated directly from environment variables, and the destination base URL is also environment-configurable via LINKFOX_TOOL_GATEWAY. That creates a real data exfiltration path for session/application metadata and credentials to an attacker-controlled endpoint if the environment is influenced by an untrusted context; in a skill that handles compliance review data, this increases privacy and tenant-separation risk.

Content

Scanner excerpt · scripts/ruiguan_image_compliance_search.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: 'req' from os.environ.get (line 57, 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/upload_image.py (reported line 73)May include surrounding context.

python
)

    try:
        with urlopen(req, timeout=150) as response:
            result = json.loads(response.read().decode("utf-8"))
    except HTTPError as e:
        body = e.read().decode("utf-8") if e.fp else ""

Tainted flow: 'req' from os.environ.get (line 57, 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/upload_image.py (reported line 106)May include surrounding context.

python
)

    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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill instructs uploading local images to an external OSS service and returning a public URL, but this data transfer is not part of the declared core behavior and is under-disclosed. Publicly exposing user-supplied local images can leak sensitive product, customer, or proprietary information and silently broadens the tool from compliance checking into external file publication.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill instructs uploading local images to an external OSS service and returning a public URL, but this data transfer is not part of the declared core behavior and is under-disclosed. Publicly exposing user-supplied local images can leak sensitive product, customer, or proprietary information and silently broadens the tool from compliance checking into external file publication.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill instructs uploading local images to an external OSS service and returning a public URL, but this data transfer is not part of the declared core behavior and is under-disclosed. Publicly exposing user-supplied local images can leak sensitive product, customer, or proprietary information and silently broadens the tool from compliance checking into external file publication.

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

Image: https://example.com/new-product.png

text

## Display Rules

1. **Show results in a clear table**: Present each matched violation with its image, similarity score, and product titles
2. **Highlight high-similarity matches**: When the cosine score exceeds 0.8, clearly flag the result as a strong match that likely requires attention

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The onboarding document introduces account registration, login, API key retrieval, and billing/payment handling that are outside the stated purpose of an image compliance review skill. This expands the skill into credential handling and payment workflows, increasing attack surface and creating opportunities for unnecessary collection of secrets and sensitive user data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented flow asks the agent to collect a user's phone number, process verification-code login, and initiate plan purchase/payment operations even though the skill is supposed to perform product-image compliance checks. In this context, these capabilities are unjustified and dangerous because they enable unnecessary handling of personal data, authentication factors, and commercial transactions through a non-payment skill.

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

The implementation is fundamentally unrelated to the declared purpose of product image compliance detection and instead performs account onboarding, SMS login, API key retrieval, billing, and payment QR generation. This kind of scope mismatch is dangerous because it can trick users or orchestrators into invoking a credential- and payment-handling workflow under a benign compliance-review label.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file contains billing and purchase operations, including order creation and payment QR rendering, which are not justified by an image compliance-checking skill. In context, this expands the blast radius from analysis to financial actions and creates risk of unauthorized purchases, deceptive monetization, or payment phishing under the guise of compliance tooling.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code performs SMS login, token-based account login, user/team enumeration, and API token generation, all outside the stated compliance-review scope. In context, these capabilities enable credential collection and privileged token minting, making the skill far more dangerous than advertised and increasing the likelihood of account compromise or covert account linking.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation contradicts its own stated storage guarantees by falling back to home and temporary directories, including /tmp-derived locations, when the preferred directory is not writable. This can place full API responses and session metadata into less trusted shared locations, undermining operator expectations and increasing the chance of unauthorized local access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is described as performing image-based compliance detection, but this file only uploads local images and returns a public URL. That mismatch creates a risky hidden capability: users or downstream components may invoke a data-exfiltration utility under the guise of compliance review, increasing the chance of unintended disclosure of sensitive product images.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares no explicit tool scope or allowed-tools despite requiring environment access, file writes, and network calls. This creates an authority gap where the skill can access sensitive capabilities without transparent restriction, increasing the risk of secret exposure, unintended persistence, or unreviewed outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger conditions are overly broad and cause the skill to activate for loosely related image-comparison or compliance-like requests, even when the user did not explicitly ask for this service. Overbroad activation increases the chance of unintended external calls, unnecessary data disclosure, and user confusion about what system is being invoked.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The local image upload flow lacks an explicit warning that a local file will be transmitted to an external service and converted into a publicly accessible URL. In a security-sensitive context, silent exfiltration and publication of local files is dangerous because users may provide confidential images assuming they remain local.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
71% confidence
Finding

The file presents the skill documentation entirely in Chinese, which can constitute a language/locale policy issue when no user choice or justification is provided. There is no statement that the skill is region-specific or that users may opt into this locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The API requires sending a user-supplied image URL to an external compliance service but provides no privacy, retention, or data-handling warning. Users may unknowingly submit URLs that contain sensitive product information, internal storage locations, signed URLs, or personal data, resulting in unintended third-party disclosure.

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

}

text

## curl 示例

```bash
curl -X POST https://tool-gateway.linkfox.com/ruiguan/gunPartsSearch \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation adds a separate feedback-reporting API that is unrelated to the stated image compliance detection function, expanding the skill's effective capabilities beyond user expectations. This creates a data-flow and scope-creep risk because an integrator or agent may send user content to a second external service without clear necessity, consent boundaries, or least-privilege justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The feedback section documents transmission of user feedback content to a separate external endpoint without warning that the content leaves the primary tool path. That can lead to accidental exfiltration of user messages, complaint details, or operational context to a third party without informed consent or minimization.

Content

No source excerpt is available for this finding.