Back to skill

Security audit

AI服装人台换模特图专家

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent image-generation purpose, but it needs Review because it can execute job-supplied Python script paths and handles public uploads, credentials, and billing flows with weak scoping.

Review this carefully before installing. Use it only in a trusted environment, do not set custom LINKFOX_* gateway URLs unless you fully trust the endpoint, avoid passing untrusted job JSON files, and treat local file inputs as public once uploaded. Be cautious with the onboarding and billing commands: they handle SMS codes, API keys, and payment order creation, and the current docs expose/persist API keys in ways that should be improved.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
skills/linkfox-aigc-textgen/scripts/aigc_textgen.py:74
Finding

Unchecked endpoint overrides can redirect credentials and sensitive request data

Content
View full analysis
str: for n in (name, *fallbacks): v = os.environ.get(n) if v: return v.rstrip ...[truncated 3755 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_mannequin.py:148
Finding

Job parameters permit execution of arbitrary local Python scripts

Content
View full analysis
str: proc = subprocess.run( [sys.executable, textgen_script, "--stdin", "--content-only"], input=json.dumps(params, ensure_ascii=False), text=True, capture_output=True, timeout=TEXTGEN_TIMEOUT, ) ``` ```python def _run_imagegen(imagegen_script: str, params: dict) -> list[str]: proc = subprocess.run( [sys.executable, imagegen_script, json.dumps(params, ensure_ascii=False)], text=True, capture_output=True, timeout=IMAGEGEN_TIMEOUT, ) ``` ```python for script_key in ("textgen_script", "imagegen_script"): script_path = os.path.abspath(job[script_key]) if not os.path.isfile(script_path): raise SystemExit(f"ERROR: {script_key} path does not exist: {script_path}") job[script_key] = script_path ``` ### Technical Analysis The orchestrator reads `textgen_script` and `imagegen_script` from the externally supplied job JSON. It converts each value to an absolute path and verifies only that the target is a regular file. There is no validation that the selected file: - Resides under the packaged LinkFox Skill directories. - Has the expected filename. - Matches a trusted hash or signature. - Is owned by a trusted account. - Is not a symbolic-link target outside an approved directory. The paths are subsequently passed to the current Python interpreter. Although the subprocess calls do not use a shell and are not vulnerable to conventional shell metacharacter injection, they explicitly execute the selected file as Python code. File-existence validation does not establish trust. ### Attack Path 1. An attacker creates or identifies a malicious Python file readable by the Agent. 2. The attacker suppl ...[truncated 1069 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
skills/linkfox-aigc-textgen/scripts/onboarding.py:484
Finding

Onboarding exposes the complete reusable API key in plaintext output

Content
View full analysis
None: print(json.dumps(obj, ensure_ascii=False, indent=2)) ``` ```python 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 (source: {r['source']})", file=sys.stderr) return 0 return 1 ``` ### Technical Analysis After SMS authentication, the onboarding flow retrieves or generates a LinkFox API token and places the complete token in the returned dictionary. `_cmd_login()` then serializes that dictionary to stdout without masking or redaction. In an Agent environment, stdout commonly becomes part of: - Tool-call transcripts. - Model context. - Terminal capture. - Debug logs. - Centralized telemetry. - CI or automation logs. A reusable API credential should not be treated as ordinary machine-readable command output. The phone number is masked, but the more sensitive API key is not. ### Attack Path 1. A user chooses the phone-based onboarding path. 2. The user provides the SMS verification code. 3. The onboarding script logs in and retrieves or creates an API token. 4. `login_and_get_key()` returns the complete token under `api_key`. 5. `_emit()` prints the full token to stdout. 6. A transcript viewer, log collector, malicious extension, shared terminal recorder, ...[truncated 645 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
skills/linkfox-file-upload/SKILL.md:32
Finding

Documentation recommends installation of unpinned third-party dependencies

Content
View full analysis
None: if requests is None: raise RuntimeError("Missing requests dependency; run: pip install requests") ``` ### Technical Analysis The Skill instructs users to install `oss2`, `qrcode`, `pillow`, and `requests` without specifying reviewed versions, hashes, a lockfile, or a trusted package-index policy. Commands of the form `pip install ` resolve mutable current releases and their transitive dependencies from the configured Python package index. The effective code installed in the environment can therefore change after the Skill package has been audited. No evidence was found that the listed package names are intentional typosquatting names or that the project directly downloads and executes a known malicious package. The confirmed issue is the unsafe, non-reproducible dependency acquisition process. ### Attack Path 1. A required dependency is absent. 2. The Skill reports an installation instruction using an unpinned package name. 3. The user or Agent runs the suggested `pip install` command. 4. The installer resolves the latest available package and transitive dependency versions from the configured index or mirror. 5. If a package release, dependency, mirror, index account, or local package-source configuration has been compromised, attacker-controlled code is installed. 6. The code executes during package installation or when the Skill later imports the depe ...[truncated 624 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (72)

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

Critical
Category
Data Flow
Confidence
92% confidence
Finding

The script downloads arbitrary HTTP/HTTPS URLs from resultList and writes them to local storage without validating the destination host, size, or content beyond a loose scheme check. Because the gateway base URL is environment-controlled and the service response drives follow-on downloads, this creates an SSRF-style trust-boundary issue and can be abused to fetch unexpected internal or attacker-controlled content into the agent workspace.

Content

Scanner excerpt · skills/linkfox-aigc-imagegen/scripts/aigc_imagegen.py (reported line 202)May include surrounding context.

python
req = _lf_Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
    try:
        with _lf_urlopen(req, timeout=timeout) as resp:
            if guessed_ext == "bin":
                ct = resp.headers.get("Content-Type", "")
                if "mp4" in ct:

Tainted flow: 'req' from os.environ.get (line 297, 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 · skills/linkfox-aigc-imagegen/scripts/aigc_imagegen.py (reported line 299)May include surrounding context.

python
}
    req = Request(url, data=data, headers=headers, 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 destination URLs from environment variables and then sends authentication material, SMS-login data, and token-management requests to those endpoints via requests.post. If an attacker can influence the environment, they can redirect these calls to attacker-controlled infrastructure and exfiltrate phone numbers, SMS codes, access tokens, refresh tokens, generated API keys, and payment-related data.

Content

Scanner excerpt · skills/linkfox-aigc-imagegen/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 configuration and then used in urlopen with the Authorization header carrying the API key. An attacker who controls the environment can redirect gateway traffic and capture API keys, account metadata, package/order details, and influence billing or order-status flows.

Content

Scanner excerpt · skills/linkfox-aigc-imagegen/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 335, 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 · skills/linkfox-aigc-textgen/scripts/aigc_textgen.py (reported line 237)May include surrounding context.

python
req = _lf_Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
    try:
        with _lf_urlopen(req, timeout=timeout) as resp:
            if guessed_ext == "bin":
                ct = resp.headers.get("Content-Type", "")
                if "mp4" in ct:

Tainted flow: 'req' from os.environ.get (line 335, 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 · skills/linkfox-aigc-textgen/scripts/aigc_textgen.py (reported line 337)May include surrounding context.

python
}
    req = Request(url, data=data, headers=headers, method="POST")
    try:
        with urlopen(req, timeout=HTTP_TIMEOUT) 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
90% confidence
Finding

The code builds outbound request destinations from environment-controlled base URLs and then sends sensitive data such as phone numbers, SMS codes, access tokens, refresh tokens, and generated API keys to those endpoints. If an attacker can influence environment variables in the skill runtime, they can redirect authentication and token traffic to attacker-controlled infrastructure and exfiltrate credentials.

Content

Scanner excerpt · skills/linkfox-aigc-textgen/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 request path uses environment-derived base URLs with an Authorization header populated from LINKFOX_AGENT_API_KEY, causing secrets to be transmitted to whatever host the environment specifies. In a compromised or multi-tenant execution environment, this becomes a straightforward secret exfiltration channel.

Content

Scanner excerpt · skills/linkfox-aigc-textgen/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 274, 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 · skills/linkfox-file-upload/scripts/linkfox_paths.py (reported line 281)May include surrounding context.

python
headers={"Content-Type": "application/json", "Authorization": api_token},
        )
        try:
            with urlopen(req, timeout=30) as resp:
                body = json.loads(resp.read().decode())
            break
        except urllib.error.HTTPError as e:

Tainted flow: 'req' from os.environ.get (line 274, 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 · skills/linkfox-file-upload/scripts/linkfox_paths.py (reported line 524)May include surrounding context.

python
req = Request(url, headers={"User-Agent": "LinkFox-Skill/2.0"})
    try:
        with urlopen(req, timeout=timeout) as resp:
            # 从 Content-Type 进一步修正扩展名
            if guessed_ext == "bin":
                ct = resp.headers.get("Content-Type", "")

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to upload any non-http/https local file path via a file-upload skill and convert it to a public URL. In context, that creates a data-exfiltration risk: if an agent is given an unintended local path, the skill provides a sanctioned path to publish local files externally without clear path restrictions, type validation, or user confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs immediate execution upon receiving arguments and forbids waiting for user confirmation, even though execution triggers external API requests, asynchronous polling, and persistence of generated files and raw responses. This removes an important safety checkpoint and increases the chance of unauthorized actions, unintended spending, privacy leaks via uploaded image URLs, and filesystem side effects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements account onboarding, SMS authentication, API-key issuance, plan listing, ordering, and payment support, which is materially broader than the stated mannequin-to-model image generation purpose. That scope mismatch increases the attack surface and can surprise users by introducing credential handling and billing capabilities where only image processing is expected.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code can create orders and render payment QR codes, enabling direct billing actions from within a skill whose declared function is image transformation. In this context, embedded payment capability is dangerous because it expands consequences from image processing to unintended purchases and collection of transaction metadata.

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 · skills/linkfox-aigc-imagegen/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

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 · skills/linkfox-aigc-textgen/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 provided skill context describes mannequin-to-model image generation, but the file actually performs asynchronous text generation against /aigc/textGenAsync and /aigc/textTaskQuery. This mismatch is dangerous because it can cause reviewers, orchestrators, or users to approve or invoke a capability different from what is actually executed, enabling unintended data transmission and policy bypass.

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, plan listing, ordering, and payment QR generation, which is unrelated to the declared mannequin-to-model image generation purpose. Such capability mismatch is dangerous because it collects user credentials and enables account/payment operations under the cover of an unrelated skill, increasing the likelihood of deceptive data harvesting or unauthorized commercial actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code can create orders, query order status, and render payment QR codes despite the skill being described as an image-processing tool. Embedding billing operations in an unrelated skill creates risk of unauthorized charges, deceptive upsell flows, and payment phishing, especially when users would not expect commerce behavior from this context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script performs SMS-based login and API key issuance, collecting authentication factors and account tokens unrelated to mannequin-to-model generation. In this skill context, that behavior is especially suspicious because it can capture credentials and mint reusable API access under misleading pretenses.

Content

No source excerpt is available for this finding.