Back to skill

Security audit

Chen Nano Banana Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill performs its advertised image generation/editing task, but it under-discloses third-party upload of prompts/images and encourages unsafe API-key handling.

Review before installing. Use only non-sensitive prompts and images unless you are comfortable sending them to Google's Gemini API. Do not paste a Gemini API key into chat or pass it on the command line; prefer a protected environment variable or secret manager, and consider rotating any key already shared this way. Also consider pinning dependencies before running the uv workflow.

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 Permit Unreviewed Package Updates

Content
View full analysis
=3.10" # dependencies = [ # "google-genai>=1.0.0", # "pillow>=10.0.0", # ] # /// ``` ### Technical Analysis The inline dependency specification uses unrestricted lower-bound version constraints for `google-genai` and `pillow`. No exact versions, upper bounds, integrity hashes, or reviewed lockfile are present. When the documented `uv run` workflow resolves these requirements, it may install future package versions that did not exist when the Skill was audited. Because imported Python packages execute code within the current process, a compromised or malicious package release could execute with the same operating-system privileges as the user running the Skill. This finding concerns mutable dependency resolution. The reviewed project does not itself contain evidence that the named packages are currently malicious. ### Attack Path 1. An attacker compromises a maintainer account, distribution pipeline, or permitted future release of one of the dependencies. 2. The attacker publishes a malicious package version that satisfies `google-genai>=1.0.0` or `pillow>=10.0.0`. 3. A user invokes the Skill through the documented `uv run` command. 4. The resolver selects and installs the malicious but version-compatible release. 5. The package executes during import or normal API use inside `generate_image.py`. 6. The malicious dependency gains access to the process environment, user-readable files, prompts, input images, and Gemini credentials available to the process. ### Impact Assessment Successful exploitation would provide code execution with the privileges of the user running the Skill. The accessible scope could include: - The `GEMINI_API_KEY` environment variable or command-line credential. - Prompts and i ...[truncated 320 chars]
Remediation
View remediation
", # "pillow==", # ] ``` 2. Generate and commit a lockfile that records all transitive dependency versions. 3. Enforce package integrity hashes where the selected package-management workflow supports them. 4. Use only trusted package indexes and explicitly configure the index rather than inheriting an uncontrolled source. 5. Review dependency changes before updating the pins or lockfile. 6. Add automated vulnerability and provenance scanning to the release process. 7. Run image generation in a restricted environment with minimal filesystem access and only the required network destination. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:50
Finding

Gemini API Key Can Be Exposed Through Command-Line Arguments and Chat History

Content
View full analysis
`. 3. The plaintext key is stored in chat or tool-call history, recorded in shell or execution logs, or exposed through local process-argument inspection. 4. A local user, administrator, log reader, monitoring integration, or party with access to the retained conversation retrieves the key. 5. That party submits unauthorized Gemini API requests using the exposed credential. ### Impact Ass ...[truncated 595 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (6)

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 87)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
92% confidence
Finding

The skill invokes a local Python script and explicitly relies on environment data (GEMINI_API_KEY), but the manifest does not declare any tool scope, permissions, or allowed-tools boundaries. This creates an authorization ambiguity where the runtime may expose broader capabilities than users expect, increasing the chance of unintended environment access or misuse of secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill sends user prompts and, for editing, local input images to an external Google API, but the description does not clearly warn users that their content may leave the local environment. This can lead to unintentional disclosure of sensitive text, proprietary artwork, or personal images to a third-party service.

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 86)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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends the user prompt and, when provided, the local input image to Google's external Gemini image API without any explicit notice, consent prompt, or privacy warning at the point of transmission. In a skill that accepts arbitrary local images for editing, this can expose sensitive image contents or confidential prompts to a third-party service unexpectedly, making the data-flow risk real even if it is part of the feature's intended operation.

Content

No source excerpt is available for this finding.