Back to skill

Security audit

Nano Banana 2 — Gemini Image Generation

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be for Gemini image generation, but its setup can expose your API key and its declared command permissions are broader than needed.

Install only if you are comfortable giving the skill access to a Gemini API key and sending prompts or source images to Google services. Do not run the documented echo commands for GEMINI_API_KEY; use a boolean presence check instead, and consider narrowing/removing the broad curl and unrestricted python3 permissions before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:25
Finding

API Key Disclosed Through Verification and Troubleshooting Commands

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:12
Finding

Overly Broad Bash Network and Code-Execution Permissions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · rules/setup.md (reported line 38)May include surrounding context.

Project .env file:

bash
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore   # add immediately — never commit keys
source .env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · rules/setup.md (reported line 40)May include surrounding context.

Project .env file:

bash
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore   # add immediately — never commit keys
source .env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · rules/setup.md (reported line 39)May include surrounding context.

bash
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore   # add immediately — never commit keys
source .env

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
## API Reference

| Property             | Value                                                                                                     |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| Model                | `gemini-3.1-flash-image-preview`                                                                          |
| Endpoint             | `https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent` |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The search-grounded operation explicitly enables googleSearch with webSearch and imageSearch, which causes user prompts to be sent to external live search services. The skill metadata and workflow mention grounded generation but do not clearly warn that prompt contents may leave the local environment and be disclosed to third parties, creating a privacy and data-handling risk if users include sensitive project details, internal names, or personal data in prompts.

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 · rules/setup.md (reported line 17)May include surrounding context.

md
### Step 1: Obtain a Key

1. Go to https://aistudio.google.com/app/apikey
2. Create a new project key or copy an existing one
3. Confirm the key has access to `gemini-3.1-flash-image-preview`

### Step 2: Set the Environment Variable