Back to skill

Security audit

Nano Banana Image T8

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised image-generation workflow, but it stores API credentials and includes an unrestricted API endpoint option that could send the key and images outside the intended service.

Install only if you trust this publisher and are comfortable with a local plaintext Nano Banana API key file. Do not pass a custom --base-url, avoid putting real keys in shell history where possible, and delete or rotate the saved key if this machine or account is shared.

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/test_nano_banana_2.py:277
Finding

Unrestricted API Endpoint Allows Bearer Credential Exfiltration

Content
View full analysis
dict[str, str]: return {"Authorization": f"Bearer {api_key}"} ``` ```python parser.add_argument("--base-url", default="https://ai.t8star.cn") ``` ```python with httpx.Client(headers=_build_headers(api_key), follow_redirects=True) as client: try: size = args.size.strip() or None if mode in {"text", "both"}: print("[文生图] 测试中...") run_text_to_image( client, args.base_url.rstrip("/"), ``` The same client is used by `run_text_to_image()` and `run_image_to_image()`: ```python resp = client.post(f"{base_url}/v1/images/generations", json=payload, timeout=300) ``` ```python resp = client.post( f"{base_url}/v1/images/edits", data=form_data, files=files, timeout=300, ) ``` ### Technical Analysis The script accepts an unrestricted `--base-url` argument and creates an HTTP client with the API key installed as a client-wide `Authorization` header. Consequently, the bearer credential is sent to whichever origin is supplied through that argument. This conflicts with `SKILL.md:71`, which states that the API base address must remain fixed at `https://ai.t8star.cn`. The restriction exists only as a natural-language instruction and is not enforced in executable code. Allowing redirects with `follow_redirects=True` also enlarges the network trust boundary. Although HTTP clients may remove sensitive headers on some cross-origin redirects, security must not depend on undocumented or version-specific redirect behavior. Redirect destinations and downloadable image URLs should be explicitly constrained. ### Attack Path 1. An attacker causes the script to be invoked with an attacker-controlled base URL, for e ...[truncated 1271 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/test_nano_banana_2.py:170
Finding

API Credential Is Stored in Plaintext and Encouraged Through Command-Line Arguments

Content
View full analysis
str: if not _KEY_FILE.exists(): return "" return _KEY_FILE.read_text(encoding="utf-8").strip() def _save_api_key(api_key: str) -> None: _KEY_FILE.parent.mkdir(parents=True, exist_ok=True) _KEY_FILE.write_text(api_key.strip(), encoding="utf-8") if sys.platform != "win32": os.chmod(_KEY_FILE, 0o600) def _collect_api_key(provided_api_key: str, interactive: bool) -> str: if provided_api_key: return provided_api_key saved_key = _load_saved_api_key() if saved_key: if not interactive: return saved_key print("检测到已保存 API Key。") choice = input("输入 1 使用默认 Key,输入 2 替换 Key(默认 1): ").strip() if choice in {"", "1"}: return saved_key if choice != "2": raise SystemExit("无效选择,请输入 1 或 2") if not interactive: raise SystemExit( "缺少 API key(且无已保存 Key)。请用 --api-key 或环境变量 NANO_BANANA_API_KEY 传入。" ) entered = getpass.getpass("请输入 API Key(输入过程不可见): ").strip() if not entered: raise SystemExit( "缺少 API key,请通过 --api-key / 环境变量 NANO_BANANA_API_KEY / 交互输入提供" ) _save_api_key(entered) print(f"API Key 已保存到: {_KEY_FILE}") return entered ``` ```python parser.add_argument("--api-key", default=os.getenv("NANO_BANANA_API_KEY", "")) ``` The Skill documentation explicitly recommends placing the credential in the command line: ```bash python ~/.whaleclaw/workspace/skills/nano-banana-image-t8/scripts/test_nano_banana_2.py \ --mode text \ --api-key '
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly allows saving the user's API key to a local file and reusing it in later sessions, but it does not present a clear user-facing warning, consent flow, retention policy, or deletion mechanism. Persisting reusable credentials on disk creates a meaningful exposure if the host, account, or workspace is shared or later compromised, and the broad triggers make accidental collection more dangerous in context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill invokes bash and a Python script, handles API keys, reads files, and performs networked image-generation requests, but it does not declare any explicit tool scope or allowed-tools boundary. That increases the chance of over-broad execution in environments that rely on declarative permissions, making unintended file, shell, or network access harder to constrain and audit.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Several triggers are very broad, including generic phrases like '文生图', '图生图', and 'image generation test', which can cause the skill to activate during ordinary conversation unrelated to this specific integration. Because the skill can execute shell commands, perform network requests, and handle credentials, unintended activation raises the chance of accidental API-key capture, persistence, or outbound requests in the wrong context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

User-facing strings throughout the script are presented in Chinese, including prompts, errors, and status messages, with no option to select another language. This creates a natural-language policy issue if users are not explicitly opting into a Chinese-only interface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script stores the API key on disk in a predictable location and does so automatically after interactive entry, without an explicit opt-in confirmation immediately before persistence. Although file permissions are restricted on non-Windows systems, local credential persistence still increases exposure to other local processes, backups, sync tools, or weaker default ACL behavior on Windows.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.