Back to skill

Security audit

corespeed-nanobanana

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently provides Gemini image and text generation through Corespeed, with the main risks being expected remote data sharing and unpinned Python dependencies.

Install this only if you intend prompts and selected images to be processed by Corespeed/Google Gemini. Set CS_AI_GATEWAY_BASE_URL only to a trusted HTTPS gateway, protect CS_AI_GATEWAY_API_TOKEN, avoid sensitive files unless external processing is allowed, and prefer running it in a constrained environment with pinned dependencies for production use.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gemini.py:23
Finding

Unrestricted Gateway URL Can Expose API Credentials and User Content

Content
View full analysis
genai.Client: base_url = os.environ.get("CS_AI_GATEWAY_BASE_URL", "") api_token = os.environ.get("CS_AI_GATEWAY_API_TOKEN", "") if not base_url or not api_token: msg = "CS_AI_GATEWAY_BASE_URL and CS_AI_GATEWAY_API_TOKEN are required." if json_mode: typer.echo(json_lib.dumps({"ok": False, "error": msg})) else: typer.echo(f"Error: {msg}", err=True) raise typer.Exit(1) return genai.Client( api_key=api_token, http_options=types.HttpOptions(base_url=f"{base_url.rstrip('/')}/google-ai-studio"), ) ``` The client subsequently submits prompts and input files to the configured endpoint: ```python response = client.models.generate_content( model=model, contents=types.Content(role="user", parts=parts), config=types.GenerateContentConfig(response_modalities=resp_mod), ) ``` ### Technical Analysis `CS_AI_GATEWAY_BASE_URL` directly controls the base URL supplied to the Google GenAI client. The code only verifies that the value is nonempty. It does not validate the URL scheme, hostname, port, embedded credentials, or destination. The same client is initialized with `CS_AI_GATEWAY_API_TOKEN` and later transmits user prompts and image content through `generate_content`. Consequently, a process, deployment configuration, wrapper script, or other actor capable of modifying the gateway environment variable can redirect security-sensitive requests to an unintended endpoint. The risk is conditional on an attacker being able to influence the environment or deployment configuration. The code does not independently create that capability, but it lacks a security bounda ...[truncated 1228 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/gemini.py:2
Finding

Unpinned Runtime Dependencies Create a Supply-Chain Risk

Content
View full analysis
=3.10" # dependencies = [ # "google-genai>=1.0.0", # "typer>=0.12.0", # ] # /// ``` The Skill metadata also installs the latest available `uv` package without a version or integrity constraint: ```yaml "install": [ { "id": "uv-pip", "kind": "shell", "command": "pip install uv || pip3 install uv", "bins": ["uv"], "label": "Install uv via pip (https://github.com/astral-sh/uv)", }, ], ``` ### Technical Analysis The runtime dependencies use open-ended minimum version constraints, while the installer command requests `uv` without any version constraint. No lock file or package hashes are present in the audited project. As a result, two executions at different times can resolve different dependency versions even when the Skill source is unchanged. A compromised upstream release, compromised package-maintainer account, malicious package-index response, or unexpectedly incompatible future version could therefore introduce code that was not included in this audit. Python packages can execute code during installation and are imported into the Skill process at runtime. Such code executes with the same operating-system permissions, environment access, and file access as the user running the Skill. ### Attack Path 1. An attacker compromises an upstream package release process, maintainer account, or package source used to resolve `uv`, `google-genai`, or `typer`. 2. The attacker publishes a malicious version satisfying the unconstrained requirement. 3. A user installs `uv` or runs the script through `uv` after the malicious version becomes available. ...[truncated 1053 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

bash
# Describe an image
uv run {baseDir}/scripts/gemini.py -p "Describe this image" -f desc.txt -i photo.jpg --model gemini-2.5-flash

# Compare images
uv run {baseDir}/scripts/gemini.py -p "What are the differences?" -f diff.txt -i before.jpg -i after.jpg --model gemini-2.5-flash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

uv run {baseDir}/scripts/gemini.py -p "Describe this image" -f desc.txt -i photo.jpg --model gemini-2.5-flash

Compare images

uv run {baseDir}/scripts/gemini.py -p "What are the differences?" -f diff.txt -i before.jpg -i after.jpg --model gemini-2.5-flash

text

## Text Generation

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

bash
# Use the most capable model for complex tasks
uv run {baseDir}/scripts/gemini.py -p "Write a haiku about coding" -f haiku.txt --model gemini-2.5-pro

Models

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable behavior that reads environment variables, reads local files, and writes output files, but it does not declare an explicit tool/permission scope. That weakens least-privilege controls and makes it harder for a host agent or reviewer to understand what access the skill requires before activation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description uses broad trigger phrases like creating images, editing photos, analyzing images, or generating text, which overlap with many ordinary user requests. This can cause the skill to activate in more situations than necessary, increasing the chance that user data is sent to this skill and then onward to a remote provider without deliberate selection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documentation explains usage of a remote gateway and Gemini models but does not prominently warn that prompts and uploaded images are transmitted to an external API service. Because this skill handles images and text, users may unknowingly send sensitive content off-platform, creating privacy, confidentiality, and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This skill sends the user prompt and any supplied input image files to an external Corespeed AI Gateway/Google Gemini endpoint, but the normal CLI flow does not clearly warn users at the point of use that local file contents and prompt data will leave the host. In an agent skill context, users may provide sensitive images or text expecting local processing, so the lack of explicit disclosure creates a real privacy and data-handling risk even though the network transfer is core functionality.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.