Back to skill

Security audit

Nano Banana Pro Image Generation&Editing

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for Atlas Cloud image generation, but it downloads server-provided output URLs without validating where they point.

Review before installing if you are sensitive to third-party data transfer or host-network access. Use it only for prompts and images you are comfortable sending to Atlas Cloud, and prefer a version that restricts downloaded output URLs to documented Atlas-controlled HTTPS asset domains.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:153
Finding

Unvalidated Server-Controlled Output URLs Permit Arbitrary Resource Retrieval

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_image.py, lines 153–166 and 294–295
Vulnerability Type: Unrestricted URL retrieval / server-side request forgery (SSRF)
Risk Level: Medium

Vulnerable code:

python
def download_file(url, output_dir="."):
    parsed = urllib.parse.urlparse(url)
    filename = os.path.basename(parsed.path)
    if not filename or "." not in filename:
        filename = f"output_{int(time.time())}.png"
    output_path = os.path.join(output_dir, filename)
    base, ext = os.path.splitext(output_path)
    counter = 1
    while os.path.exists(output_path):
        output_path = f"{base}_{counter}{ext}"
        counter += 1
    print(f"Downloading: {filename}")
    urllib.request.urlretrieve(url, output_path)
    size_kb = os.path.getsize(output_path) / 1024
    print(f"Saved: {output_path} ({size_kb:.1f} KB)")
    return output_path
python
saved = []
for url in outputs:
    saved.append(download_file(url, args.output))

Technical Analysis

The script obtains output URLs from the Atlas Cloud API and passes each URL directly to urllib.request.urlretrieve() without validating its scheme, hostname, port, resolved address, or redirect destinations. Parsing the URL only to derive a filename does not establish that the remote resource is trusted.

This behavior contradicts the script's stated network boundary that network calls are limited to api.atlascloud.ai. Python URL retrieval can access arbitrary HTTP or HTTPS hosts and may support other handlers, including local file: resources. HTTP redirects are also followed without checking whether the destination remains within an approved Atlas-controlled domain.

Image generation requires retrieving generated assets, but it does not require unrestricted access to arbitrary URLs. The implementation therefore exceeds the minimum network privileges necessary for the declared functionality ...[truncated 1892 chars]

Remediation
View remediation

Remediation Suggestions

  1. Accept only https output URLs.
  2. Maintain an explicit allowlist of documented Atlas-controlled asset/CDN hostnames rather than accepting arbitrary Internet hosts.
  3. Reject URLs containing embedded credentials, unexpected ports, fragments, or malformed hostnames.
  4. Resolve the hostname and reject loopback, private, link-local, multicast, reserved, and unspecified IP addresses for both IPv4 and IPv6.
  5. Disable automatic redirects or validate every redirect target using the same scheme, hostname, port, and resolved-address policy.
  6. Replace urlretrieve() with a controlled downloader that enforces connection and read timeouts, maximum response size, and an expected image content type.
  7. Verify downloaded content using image signatures or safe image decoding rather than trusting the filename extension or Content-Type header alone.
  8. Store downloads with locally generated filenames and restrictive permissions.
  9. Document the exact approved API and CDN domains in SKILL.md so the declared network boundary matches runtime behavior.
  10. Consider having the trusted Atlas API return an asset identifier that is downloaded through a fixed, authenticated endpoint instead of returning an arbitrary URL.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares access to environment variables and performs network operations, but it does not define an explicit permission or allowed-tools scope. That creates an authorization gap where a host agent may invoke the skill with broader capabilities than users or reviewers expect, increasing the chance of unintended secret access or outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger description is very broad and includes many generic image-related tasks, so the skill could be invoked for routine requests that do not require this external service. That raises the risk of unnecessary data egress, unintended billing, and user content being sent to a third-party API without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
> **Data usage note**: This skill sends text prompts and image URLs/data to Atlas Cloud API for image generation. No data is stored locally beyond the downloaded output files.

> **Security note**: API keys are read exclusively from environment variables (`ATLASCLOUD_API_KEY`) and passed via HTTP headers — never embedded in URL query strings or command arguments. All user-provided text (prompts, file paths) must be passed through JSON request bodies to prevent shell injection. When constructing curl commands, always use a JSON payload (`-d '{...}'`) rather than string interpolation in the shell. File paths should be validated before use. The skill does not execute any user-provided code — it only sends structured API requests and downloads output files.

---

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
# Step 1: Submit
curl -s -X POST "https://api.atlascloud.ai/api/v1/model/generateImage" \
  -H "Authorization: Bearer $ATLASCLOUD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.error
import urllib.parse

API_BASE = "https://api.atlascloud.ai/api/v1"
UA = "AtlasCloud-Skill/1.0"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.error
import urllib.parse

API_BASE = "https://api.atlascloud.ai/api/v1"
UA = "AtlasCloud-Skill/1.0"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.error
import urllib.parse

API_BASE = "https://api.atlascloud.ai/api/v1"
UA = "AtlasCloud-Skill/1.0"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

python
import urllib.error
import urllib.parse

API_BASE = "https://api.atlascloud.ai/api/v1"
UA = "AtlasCloud-Skill/1.0"

Static analysis

No suspicious patterns detected.