Back to skill

Security audit

Nano banana

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently generates or edits images through Google's Gemini image API, with disclosed credential and file use but some credential-handling and dependency hygiene caveats.

Install only if you are comfortable sending prompts and any selected input images to Google's Gemini service and using a Gemini API key. Set `GEMINI_API_KEY` in the environment instead of pasting keys into chat or command-line arguments, and review dependency/version practices if reproducible execution matters.

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

T08 · Insecure Dependencies

Warning
Location
scripts/generate_image.py:2
Finding

Unpinned Runtime Dependencies Allow Unreviewed Package Versions

Content
View full analysis
=3.10" # dependencies = [ # "google-genai>=1.0.0", # "pillow>=10.0.0", # ] # /// ``` The documented execution command in `SKILL.md`, lines 13-17, invokes the script through `uv run`: ```bash uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1K|2K|4K] [--api-key KEY] ``` ### Technical Analysis Both third-party dependencies use open-ended minimum-version constraints. The project contains no reviewed lockfile or dependency hashes. Consequently, `uv run` can resolve and install a future compatible release whose code was not included in this audit. Python packages can execute code during installation or import. This script imports both dependencies and subsequently gives the Google client access to the API credential, prompt, and optional input image. This does not establish that either current dependency is malicious; the issue is that execution is not reproducible and the effective dependency code can change after review. ### Attack Path 1. An upstream dependency release or configured package source is compromised, or a future compatible release introduces malicious behavior. 2. The user invokes the documented `uv run` command. 3. Dependency resolution selects the affected release because the requirement accepts every version at or above the stated minimum. 4. The package is installed and imported into the process. 5. Malicious package code executes with the same operating-system privileges and environment access as the Agent process. ### Impact Assessment Successful exploitation could expose the `GEMINI_API_KEY`, prompts, input images, and other files or environment variables accessibl ...[truncated 205 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:53
Finding

Gemini API Key Can Be Exposed Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (5)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
- Prompt "A serene Japanese garden" → `2025-11-23-14-23-05-japanese-garden.png`
- Prompt "sunset over mountains" → `2025-11-23-15-30-12-sunset-mountains.png`
- Prompt "create an image of a robot" → `2025-11-23-16-45-33-robot.png`
- Unclear context → `2025-11-23-17-12-48-x9k2.png`

## Image Editing

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

python
def get_api_key(provided_key: str | None) -> str | None:
    """Get API key from argument first, then environment."""
    if provided_key:
        return provided_key
    return os.environ.get("GEMINI_API_KEY")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill invokes a script that can read environment variables for GEMINI_API_KEY, but the manifest declares no explicit tool scope or permissions boundary. That weakens auditability and increases the chance the skill is auto-invoked without users understanding it may access secrets from the environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description is broad enough to match many generic image-related requests, which can cause over-triggering of a skill that executes local commands and uses API credentials. In practice this can lead to unintended external API calls, cost exposure, or misuse of local files during image-edit workflows.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
Examples:
- Prompt "A serene Japanese garden" → `2025-11-23-14-23-05-japanese-garden.png`
- Prompt "sunset over mountains" → `2025-11-23-15-30-12-sunset-mountains.png`
- Prompt "create an image of a robot" → `2025-11-23-16-45-33-robot.png`
- Unclear context → `2025-11-23-17-12-48-x9k2.png`

## Image Editing