Back to skill

Security audit

Nano Banana Pro CN

Security checks for vulnerabilities and agentic risk

Overview

This image tool appears to do its advertised job, but it can upload any local file path it is given to a third-party API without validating that the file is really an image.

Review before installing. Use this only with images and prompts you are comfortable sending to APIYi, avoid passing sensitive file paths, and run it in a restricted workspace where the process cannot read credentials, private keys, or unrelated documents. Prefer an environment variable for the API key rather than the command-line flag, and confirm which backend/provider you expect to process the images.

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

Warning
Location
scripts/generate_image.py:85
Finding

Arbitrary Local File Disclosure Through Unvalidated Python Image Input

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.js:153
Finding

Arbitrary Local File Disclosure Through Unvalidated Node.js Image Input

Content
View full analysis
0) { if (args.inputImages.length > 14) { exitWithError(`错误: 输入图片最多支持14张,当前为 ${args.inputImages.length} 张`); } for (const imgPath of args.inputImages) { if (!fs.existsSync(imgPath)) { exitWithError(`错误: 输入图片不存在: ${imgPath}`); } const imageBase64 = encodeImageToBase64(imgPath); parts.push({ inlineData: { mimeType: 'image/png', data: imageBase64, }, }); } modeStr = '编辑图片'; } ``` ```javascript data = await postJson(url, headers, payload, 120_000); ``` ### Technical Analysis The preferred Node.js implementation has the same trust-boundary weakness as the Python fallback. It accepts one or more arbitrary paths from `--input-image`, checks only whether each path exists, and then reads the complete object with `fs.readFileSync()`. No content decoding or image-signature validation occurs. A regular text file, credential file, symbolic-link target, or other readable filesystem object can therefore be Base64-encoded and placed in the request as `image/png`. The resulting JSON payload is sent to the declared APIYi endpoint. Uploading genuine user-selected images is necessary for image-editing functionality and is documented by the Skill. Nevertheless, unrestricted local file access exceeds the minimum privileges needed because only actual, explicitly approved image files should be eligible for upload. ### Attac ...[truncated 1242 chars]
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 (23)

Tainted flow: 'headers' from os.environ.get (line 126, 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/generate_image.py (reported line 201)May include surrounding context.

python
print(f"输出请求参数: {json.dumps(payload_log, indent=2, ensure_ascii=False)}")
    print(f"image generation in progress...")
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=400)
        response.raise_for_status()

        data = response.json()

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs the agent to use environment variables and make outbound network requests to a third-party image generation proxy, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent ecosystem, missing permission declarations weakens least-privilege controls and can allow broader-than-intended access to secrets or network capabilities during execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language content of the skill, including its description, usage instructions, and examples, is presented only in Chinese. Under the policy, forcing a specific language without giving the user an explicit choice or documenting a justified locale restriction is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L034-L035 instructs that the default resolution is 2K, suggesting the skill should actively use 2K unless otherwise specified. But L152 says that if resolution is omitted, it is not included in the request and the API side decides; L178 also labels the default as 2K. These statements conflict on actual behavior and can mislead operators about what the skill does.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The API key guidance is contradictory and includes passing the secret on the command line, which is commonly exposed via shell history, process listings, logs, and audit trails. In a skill that invokes local commands, normalizing CLI secret input increases the risk of credential leakage to other users or monitoring systems on the host.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill metadata claims to use NanoBananaPro, but the code actually sends prompts and images to a Gemini 3 Pro image endpoint through a third-party proxy. This mismatch can mislead users and operators about where sensitive image data and prompts are processed, undermining informed consent, data handling expectations, and security review assumptions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The script transmits user prompts, API credentials, and optionally base64-encoded local images to an external service at apiyi.com. In an image-editing skill, this is expected functionality, but it is still security-relevant because local files may contain sensitive content and the skill description emphasizes domestic proxy access rather than clearly foregrounding third-party data exfiltration risk.

Content

Scanner excerpt · scripts/generate_image.js (reported line 336)May include surrounding context.

js
const apiKey = getApiKey(args.apiKey);
  const url =
    'https://api.apiyi.com/v1beta/models/gemini-3-pro-image-preview:generateContent';

  const headers = {
    Authorization: `Bearer ${apiKey}`,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script transmits user prompts and, in edit mode, locally supplied images to a third-party remote service, but it provides no explicit privacy warning or consent checkpoint at the point of use. In a skill context, this can cause users to unknowingly send sensitive images or confidential text off-host to an external provider/proxy.

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/generate_image.py (reported line 123)May include surrounding context.

python
api_key = get_api_key(api_key)
    url = (
        "https://api.apiyi.com/v1beta/models/gemini-3-pro-image-preview:generateContent"
    )

    headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The script sends user-supplied prompt text and optional input images to an external HTTPS endpoint for processing. This is core functionality, but in security terms it is still an external data transmission path that may expose sensitive user content to a third-party service, especially because the service is described as a domestic proxy for another model provider.

Content

Scanner excerpt · scripts/generate_image.py (reported line 201)May include surrounding context.

python
print(f"输出请求参数: {json.dumps(payload_log, indent=2, ensure_ascii=False)}")
    print(f"image generation in progress...")
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=400)
        response.raise_for_status()

        data = response.json()

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad phrases such as '生成图片', '图片生成', and 'image generation', which can match many ordinary requests and cause the skill to activate when the user did not specifically intend to use this provider-backed image tool. Because the skill requires an API-backed external service, unintended invocation can lead to unnecessary external data transfer, accidental use of configured credentials, and confusion about which tool is operating.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

At L027 the guidance says output filenames '需包含文件随机标识,避免重复' and implies uniqueness via randomness. However, L150 describes automatic naming as only a timestamp-based PNG filename. This is a direct documentation inconsistency about how filename uniqueness is ensured.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains only Chinese-language instructions and examples, with no note that the skill supports other languages or that Chinese is an intentional locale constraint. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

文件顶部说明将该脚本描述为“基于NanoBananaPro/Gemini 3 Pro”,而帮助文本在 L060 单独宣称是“基于Gemini 3 Pro的图片生成与编辑工具”。同时代码实际调用的也是 gemini-3-pro-image-preview 接口,这与技能清单强调的 NanoBananaPro 模型表述形成明显不一致,属于文档层面的意图漂移。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions and argument descriptions in the module docstring are entirely Chinese, and no alternative language or opt-in is offered. Under the stated policy, forcing a specific language without user choice can be a locale-policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description is written entirely in Chinese and does not indicate any language choice or opt-in for users. This can create a language/locale policy concern if the skill is presented in multilingual contexts without making the language expectation explicit.

Content

No source excerpt is available for this finding.