Back to skill

Security audit

AIGC服装图生成

Security checks for vulnerabilities and agentic risk

Overview

The skill can generate clothing marketing images, but it also handles login, API-key, and payment flows and has unsafe endpoint and script-path flexibility that warrants review before installation.

Install only if you trust LinkFox and need this paid clothing image workflow. Prefer self-service API-key setup, do not enter a phone number or SMS code unless you initiated the login, keep API keys out of logs and shell history, do not override LINKFOX_* API URLs, and avoid using job or state files from untrusted sources until script-path validation is fixed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:68
Finding

Configurable Authentication Endpoints Can Expose User Credentials

Content
View full analysis
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 def _login_by_token(access_token: str, refresh_token: str) -> dict: """New-user credit grant. Failure does not block the remaining flow.""" resp = _http_post(f"{_agent_user_base()}/account/loginByToken", { "token": access_token, "refreshToken": refresh_token, "device": {"aid": "3026344186", "did": "", "type": "Windows", "os": "10", "model": "149.0.0.0", "brand": "Chrome"}, }, _headers("agent-linkfox-web", "agent.linkfox.com", access_token=access_token)) if "_error" in resp: return {"error": f"loginByToken: {resp.get('_body') or resp['_error']}"} if resp.get("errcode") != 200: return {"error": f"loginByToken: {resp.get('errmsg') or json.dumps(resp, ensure_ascii=False)}"} print(f"{TAG} loginByToken succeeded and new-user credits were triggered", file=sys.stderr) return {} def _fetch_user_info_v3(access_token: str, user_id: str) -> dict: """Obtain group_id and member_id from userInfo.""" resp = _http_post(f"{_login_base()}/linkFoxApp/api/userCenter/userInfo", {}, _headers("agent-linkfox-web", "ag ...[truncated 3256 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/collection_pipeline/utils.py:319
Finding

Untrusted Job and State Files Can Select Arbitrary Python Scripts for Execution

Content
View full analysis
None: """Write absolute downstream script paths; preserve an existing path if its file exists.""" for script_key in ( "textgen_script", "imagegen_script", "brand_gene_save_script", "run_one_task_script", ): resolved = scripts[script_key] existing = job.get(script_key) if existing and os.path.isfile(os.path.abspath(str(existing))): job[script_key] = os.path.abspath(str(existing)) else: job[script_key] = resolved ``` ```python with open(args.state, encoding="utf-8") as f: state = json.load(f) total = len(state["task_specs"]) run_script = state["run_one_task_script"] saved_re = re.compile(r"Saved full response:\s*(.+?)\s*$", re.M) def run_one(i): # Child-task output is captured and not forwarded to dispatch stdout. proc = subprocess.run( [sys.executable, run_script, "--state", args.state, "--index", str(i)], text=True, capture_output=True, ) ``` ```python def _run_textgen(textgen_script: str, params: dict, task_id: str) -> str: """Invoke the official aigc_textgen.py script.""" 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, task_id: str) -> list[str]: """Invoke the official aigc_imagegen.py script.""" proc = subprocess.run( [sys.executable, imagegen_scrip ...[truncated 3135 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (86)

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The script builds request destinations from environment variables such as LINKFOX_LOGIN_API_URL and LINKFOX_AGENT_USER_API_URL, then sends sensitive data including phone numbers, SMS codes, access tokens, refresh tokens, and derived headers to those endpoints. If an attacker can influence the environment or deployment configuration, they can redirect these requests to an attacker-controlled server 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
94% confidence
Finding

The gateway URL is derived from environment configuration and used by urllib to send authenticated requests with the API key in the Authorization header. A poisoned environment can redirect account, package, order, and payment-related traffic to an attacker endpoint, leaking API credentials and potentially enabling SSRF-like outbound access from the host.

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

The skill documentation includes an onboarding path that handles authentication failures, API key acquisition, account/team inspection, plan purchase, order creation, and payment QR generation—capabilities materially unrelated to apparel image generation. Combining commerce/account operations with broad shell/network/file privileges under a misleading imagegen skill increases the risk of phishing-like credential collection, unauthorized billing actions, and misuse of account resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill documentation includes an onboarding path that handles authentication failures, API key acquisition, account/team inspection, plan purchase, order creation, and payment QR generation—capabilities materially unrelated to apparel image generation. Combining commerce/account operations with broad shell/network/file privileges under a misleading imagegen skill increases the risk of phishing-like credential collection, unauthorized billing actions, and misuse of account resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill documentation includes an onboarding path that handles authentication failures, API key acquisition, account/team inspection, plan purchase, order creation, and payment QR generation—capabilities materially unrelated to apparel image generation. Combining commerce/account operations with broad shell/network/file privileges under a misleading imagegen skill increases the risk of phishing-like credential collection, unauthorized billing actions, and misuse of account resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill documentation includes an onboarding path that handles authentication failures, API key acquisition, account/team inspection, plan purchase, order creation, and payment QR generation—capabilities materially unrelated to apparel image generation. Combining commerce/account operations with broad shell/network/file privileges under a misleading imagegen skill increases the risk of phishing-like credential collection, unauthorized billing actions, and misuse of account resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill documentation includes an onboarding path that handles authentication failures, API key acquisition, account/team inspection, plan purchase, order creation, and payment QR generation—capabilities materially unrelated to apparel image generation. Combining commerce/account operations with broad shell/network/file privileges under a misleading imagegen skill increases the risk of phishing-like credential collection, unauthorized billing actions, and misuse of account resources.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 要多张 / 多类型 / 套图(如"做一套图""出5张图") | **套图编排** | Read `references/runtime/00-index.md` → 按步 Read `01-plan` / `02-confirm` → 调 `scripts/run_collection_pipeline.py` *

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 要多张 / 多类型 / 套图(如"做一套图""出5张图") | **套图编排** | Read `references/runtime/00-index.md` → 按步 Read `01-plan` / `02-confirm` → 调 `scripts/run_collection_pipeline.py` *

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

High
Category
YARA Match
Confidence
75% confidence
Finding

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

Content

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

md
证码后:`python scripts/onboarding.py login <phone> <code>`(workbuddy 宿主加 `--channel workbuddy`)
   - 拿到 `api_key` 后把下面三平台配置转发给用户,提示重启会话生效:
     - Windows PowerShell(永久):`setx LINKFOX_AGENT_API_KEY "<key>"`
     - macOS zsh:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.zshrc && source ~/.zshrc`
     - Linux bash:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.bashrc && source ~/.bashrc`
     - 变量名 `LINKFOX_AGENT_API_KEY`(主推)或 `LINKFOXAGENT_API_KEY`(老规范)任一即可

**billing 场景**:`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。
- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单,否则输出编号清单让用户选
- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`(通常 `wechat/alipay`)
- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG

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 · scripts/build_imagegen_prompt.py (reported line 94)May include surrounding context.

python
prompt = m.group(1).strip()
    if not prompt:
        raise ValueError(f"{ref_path} 的 ```text``` 代码块为空")
    return prompt


def _read_template(name: str) -> str:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The function trusts job-controlled script paths such as textgen_script, imagegen_script, and run_one_task_script and persists them into execution state for later use. In a skill intended only for clothing-image planning, allowing caller-specified external scripts creates a broad execution boundary that can be abused to run unintended code or substitute a malicious sibling skill, especially in multi-tenant or untrusted job contexts.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code prepends a state-controlled scripts directory to sys.path and imports a module by name, so anyone who can influence skill_root/state can cause arbitrary Python code execution during import. In this skill context, that is especially dangerous because a nominally image-generation workflow can be turned into general local code execution unrelated to the declared purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This skill is described as clothing image generation, but the file implements account onboarding, SMS login, API-key issuance, subscription discovery, ordering, and payment QR generation. That capability mismatch is dangerous because it enables collection of user phone numbers, login codes, and payment actions that users would not reasonably expect from an image-generation skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script includes package enumeration, order creation, payment URL processing, and QR-code rendering, none of which are justified by the declared image-generation function. Embedding commerce operations in an unrelated skill increases phishing and unauthorized-purchase risk because the skill can steer users into payments under misleading functional expectations.

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 fetch or generate API tokens for a user's group after SMS-based login, which is a powerful credential-issuance capability unrelated to clothing image generation. If abused, it can grant persistent access to backend services beyond the immediate session, turning a simple skill interaction into account compromise or unauthorized API use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Forcing selling_point to always be output in Chinese regardless of the requested language violates input expectations and can override user or platform locale requirements. In a commercial content pipeline this can cause compliance, quality, and review failures, and creates an instruction-conflict pattern where hidden template behavior supersedes explicit user input.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares broad capabilities including shell, file read/write, network access, and environment-variable use, but does not define an explicit tool scope or permission boundary. In an agentic environment, this increases the risk of over-privileged execution, unintended downstream access, or abuse of sensitive resources such as local files and API credentials.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains user-facing invocation and operating instructions exclusively in Chinese, including trigger phrases and error-handling guidance. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file title and all user-facing routing instructions are written exclusively in Chinese, and the reply template at L128-L131 is also prescribed in Chinese without any opt-in or alternative locale handling. This creates a natural-language locale constraint that may force a specific language regardless of the user's preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill hard-codes Chinese output for the point field regardless of user locale or market, which can override user expectations and downstream system language requirements. In this commerce-content generation context, forcing a mismatched language can produce unusable or misleading planning artifacts and may cause the agent to disregard explicit user instructions about output language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file requires image_desc and desc to always be in Chinese, even though the skill is used for multiple markets such as Amazon and may infer non-Chinese locales elsewhere in the workflow. This creates a prompt-quality and policy-compliance risk because the agent may ignore user language, generate inaccessible content, or feed Chinese-only internal plans into later stages that expect market-appropriate language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The document is written as an operational instruction set in Chinese and does not indicate that language selection is optional or based on user preference. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The onboarding flow instructs operators to collect a user's phone number and drive a scripted registration/login flow, but it does not require explicit informed consent, data minimization, or any warning about handling personally identifiable information. In a support workflow, this can normalize unnecessary collection of sensitive data and create privacy/compliance risk if phone numbers or OTP-related data are mishandled, logged, or retained.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document tells users to persist an API key in shell startup files or environment variables without warning that the key is a credential that may be exposed to other local users, shell history, backups, support screenshots, or subprocesses. While common operationally, presenting this as the default path without security caveats increases the chance of credential leakage and unauthorized API use.

Content

No source excerpt is available for this finding.