Back to skill

Security audit

BizyAir 图生图(Image-to-Image)助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real BizyAir image-to-image workflow, but its upload script can send any readable local file to external storage if given that path.

Review before installing. Use only non-sensitive images, verify the exact resolved path before upload, and do not let the agent infer file paths from untrusted prompts. Prefer BIZYAIR_API_KEY or a secret store over --api-key, run the skill in an isolated environment, and install reviewed pinned dependencies. Install only if you are comfortable sending selected images and prompts to BizyAir/Alibaba OSS for processing.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/i2i_workflow.py:125
Finding

Unrestricted Local File Upload to External Storage

Content
View full analysis
str: """上传图片并返回 URL""" if not api_key: api_key = get_api_key() file_path = Path(file_path).resolve() if not file_path.exists(): print(f"❌ 文件不存在: {file_path}") sys.exit(1) file_name = file_path.name print(f"📁 上传图片: {file_name}") # 获取上传凭证 upload_params = get_upload_token(file_name, api_key) # 上传到 OSS if not upload_to_oss( region=upload_params["region"], endpoint=upload_params["endpoint"], bucket=upload_params["bucket"], object_key=upload_params["object_key"], file_path=str(file_path), access_key_id=upload_params["access_key_id"], access_key_secret=upload_params["access_key_secret"], security_token=upload_params["security_token"], ): sys.exit(1) ``` ### Technical Analysis The image-to-image workflow legitimately requires uploading a user-selected image. However, the implementation only verifies that the resolved path exists. It does not verify that the path: - Refers to a regular file. - Contains a valid image. - Has an approved image format. - Is within an expected user-controlled directory. - Is below a safe size limit. - Is not a symbolic link to a sensitive file. As a result, the `--image` argument can identify any locally readable filesystem object accepted by the OSS client. Sensitive files such as environment files, SSH private keys, cloud credentials, application configuration, or agent state could therefore be sent to external BizyAir-provided Alibaba OSS storage. This exceeds the minimum filesystem privileges necessary for the declared image-to-image functionality. ### Attack Path 1. An attacker supplies a request that presents a sensitive local ...[truncated 1260 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/i2i_workflow.py:333
Finding

API Key Exposure Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/i2i_workflow.py:14
Finding

Unpinned Runtime Dependency Installation Guidance

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tainted flow: 'headers' from os.environ.get (line 215, credential/environment) → requests.get (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/i2i_workflow.py (reported line 49)May include surrounding context.

python
headers = {"Authorization": f"Bearer {api_key}"}
    params = {"file_name": file_name, "file_type": "inputs"}

    response = requests.get(UPLOAD_TOKEN_URL, headers=headers, params=params)

    if response.status_code != 200:
        print(f"❌ 获取上传凭证失败: HTTP {response.status_code}")

Tainted flow: 'headers' from os.environ.get (line 215, credential/environment) → requests.post (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/i2i_workflow.py (reported line 113)May include surrounding context.

python
}
    data = {"name": name, "object_key": object_key}

    response = requests.post(COMMIT_RESOURCE_URL, headers=headers, json=data)

    if response.status_code != 200:
        print(f"❌ 提交资源失败: HTTP {response.status_code}")

Tainted flow: 'headers' from os.environ.get (line 215, credential/environment) → requests.post (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/i2i_workflow.py (reported line 192)May include surrounding context.

python
print(f"   提示词: {prompt[:50]}...")
    print(f"   比例: {aspect_ratio}")

    response = requests.post(TASK_CREATE_URL, headers=headers, json=payload)

    if response.status_code != 200:
        print(f"❌ 创建任务失败: HTTP {response.status_code}")

Tainted flow: 'headers' from os.environ.get (line 215, credential/environment) → requests.get (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/i2i_workflow.py (reported line 218)May include surrounding context.

python
headers = {"Authorization": f"Bearer {api_key}"}

    print(f"🔍 查询任务结果...")
    response = requests.get(TASK_OUTPUTS_URL, params={"requestId": request_id}, headers=headers)

    if response.status_code != 200:
        print(f"❌ 查询失败: HTTP {response.status_code}")

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description says the assistant will use a local image as reference, but it does not clearly warn at activation time that the image will be uploaded to BizyAir's remote servers. This is a significant privacy and data-handling issue because users may provide sensitive local images without informed consent, and the skill's core workflow depends on external transfer.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes Python scripts that require environment variables and make outbound network requests, but it does not declare any explicit tool scope or permissions. This creates a transparency and containment gap: a host may allow the skill to access local files, secrets, and external services without clear user or platform review of those capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases include broad natural-language expressions such as '根据这张图片生成' and '参考图片生成', which can match ordinary conversation and cause the skill to activate unexpectedly. In this skill's context, accidental activation is more dangerous because activation can lead to local image handling and upload to a remote server.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

L003 和 L010 以中文直接规定技能身份与交互方式,但没有说明仅面向中文用户,也没有给出语言可选项。若技能默认强制单一语言而未提供用户选择,属于自然语言层面的语言/区域策略风险。

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

python
import requests
import json

url = "https://api.bizyair.cn/w/v1/webapp/task/openapi/create"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

清单描述该技能会“将本地图片上传后作为参考”进行图生图,但代码里 2:LoadImage.image 使用的是一个固定的远程 OSS 图片 URL,且后续直接调用生成接口,没有任何本地文件读取或上传逻辑。这说明当前代码行为更像是‘基于预置网络图片发起图生图请求’,与描述的本地图片上传流程不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The prompt text explicitly requires that the generated content be in Simplified Chinese and clearly visible, imposing a specific language/locale choice in natural-language instructions. The file does not offer any user choice or opt-in for this locale requirement.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The code transmits user-supplied prompt and image-reference data to an external service over the network. In this skill's context, that is expected functionality, but it is still security-relevant because users may provide sensitive images or text, and the sample includes no guardrails around consent, data classification, or handling of third-party processing.

Content

Scanner excerpt · scripts/api.py (reported line 20)May include surrounding context.

python
}
    }

response = requests.post(url, headers=headers, json=data)
result = response.json()
print("生成结果:", result)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code sends image and prompt content to an external third-party API without any visible consent, disclosure, or warning mechanism. In a skill context that suggests users provide their own images, this can expose personal, copyrighted, or sensitive content to an external processor without the user understanding where their data is going.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code presents its title, help, prompts, and error messages in Chinese only, including the module docstring and user-facing CLI output. That forces a specific language experience without user opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The script uploads user-provided image metadata and commits the resource to an external third-party service, which constitutes real external data transmission. In this skill context, that is expected functionality, but it is still security-relevant because local image content and associated identifiers leave the host and may expose sensitive user data if users are not clearly informed.

Content

Scanner excerpt · scripts/i2i_workflow.py (reported line 113)May include surrounding context.

python
}
    data = {"name": name, "object_key": object_key}

    response = requests.post(COMMIT_RESOURCE_URL, headers=headers, json=data)

    if response.status_code != 200:
        print(f"❌ 提交资源失败: HTTP {response.status_code}")

Tainted flow: 'data' from requests.get (line 225, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/i2i_workflow.py (reported line 113)May include surrounding context.

python
}
    data = {"name": name, "object_key": object_key}

    response = requests.post(COMMIT_RESOURCE_URL, headers=headers, json=data)

    if response.status_code != 200:
        print(f"❌ 提交资源失败: HTTP {response.status_code}")

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The script transmits the user's prompt and previously uploaded image URL to an external image-generation API. This is expected for the feature, but it is still a genuine data-exposure risk because prompts may contain confidential information and reference images may be sensitive; the skill context increases relevance because the entire purpose is sending local content off-device for processing.

Content

Scanner excerpt · scripts/i2i_workflow.py (reported line 192)May include surrounding context.

python
print(f"   提示词: {prompt[:50]}...")
    print(f"   比例: {aspect_ratio}")

    response = requests.post(TASK_CREATE_URL, headers=headers, json=payload)

    if response.status_code != 200:
        print(f"❌ 创建任务失败: HTTP {response.status_code}")

Tainted flow: 'request_id' from requests.get (line 203, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/i2i_workflow.py (reported line 218)May include surrounding context.

python
headers = {"Authorization": f"Bearer {api_key}"}

    print(f"🔍 查询任务结果...")
    response = requests.get(TASK_OUTPUTS_URL, params={"requestId": request_id}, headers=headers)

    if response.status_code != 200:
        print(f"❌ 查询失败: HTTP {response.status_code}")