Back to skill

Security audit

Nano banana 2

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to provide the advertised Pixwith image generation workflow, but it needs review because its shell command examples may handle user prompts and API values unsafely and it uploads local images to third-party storage.

Review before installing. Use it only when you intend to send prompts and selected images to Pixwith and its upload storage, avoid using sensitive/private photos unless you accept that transfer, protect the PIXWITH_API_KEY as a paid-service credential, and prefer an implementation that builds JSON with a serializer rather than substituting user text into shell commands.

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
SKILL.md:134
Finding
Unsafe interpolation of user-controlled and API-controlled values into shell commands<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:134-143`, `SKILL.md:155-156`, and `SKILL.md:225-235` **Vulnerability Type**: Shell command injection through unsafe construction of JSON request bodies **Risk Level**: Medium ### Vulnerable Code Text-to-image task creation: ```bash curl -s -X POST https://api.pixwith.ai/api/task/create \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ -d '{ "prompt": "<user_prompt>", "model_id": "0-41", "options": { "prompt_optimization": true, "resolution": "1K", "aspect_ratio": "1:1" } }' ``` Task-status polling: ```bash curl -s -X POST https://api.pixwith.ai/api/task/get \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ -d '{"task_id": "<task_id>"}' ``` Image-to-image task creation: ```bash curl -s -X POST https://api.pixwith.ai/api/task/create \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ -d '{ "prompt": "<edit_instruction>", "image_urls": ["<image_url_1>", "<image_url_2>"], "model_id": "0-41", "options": { "prompt_optimization": true, "resolution": "1K", "aspect_ratio": "0" } }' ``` ### Technical Analysis The documented command templates place dynamic values such as the user prompt, edit instruction, image URLs, and API-returned task identifier inside single-quoted shell arguments. If an agent implements the instructions by directly replacing the placeholders before executing the command, an attacker-controlled single quote can terminate the shell-quoted JSON string. Subsequent shell metacharacters can then introduce an additional command. JSON escaping is not sufficient to prevent this issue because JSON and the shell have separate parsing contexts. A value must first be serialized safely as JSON and must then be passed to the shell without being reinterpreted as executable syntax. The task identifier is returned by the external API ...[truncated 2237 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not perform textual substitution inside shell-quoted JSON. Store every dynamic value in a shell variable and use a JSON serializer such as `jq`: ```bash request_body="$(jq -n \ --arg prompt "$USER_PROMPT" \ --arg model_id "0-41" \ --arg resolution "1K" \ --arg aspect_ratio "1:1" \ '{ prompt: $prompt, model_id: $model_id, options: { prompt_optimization: true, resolution: $resolution, aspect_ratio: $aspect_ratio } }')" curl -sS -X POST "https://api.pixwith.ai/api/task/create" \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ --data-binary "$request_body" ``` 2. Serialize polling requests in the same manner: ```bash request_body="$(jq -n --arg task_id "$TASK_ID" '{task_id: $task_id}')" curl -sS -X POST "https://api.pixwith.ai/api/task/get" \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ --data-binary "$request_body" ``` 3. Construct the `image_urls` array through the serializer rather than concatenating URL strings. Validate that each URL uses HTTPS and belongs to an explicitly authorized host before submitting it. 4. Treat all API response values as untrusted data even when they must be preserved exactly. “Use exactly as returned” should mean passing a value unchanged through safe variable and serialization APIs, not embedding it into executable shell text. 5. Prefer a language-native HTTP client with structured JSON encoding over generated shell commands where possible. 6. Add adversarial tests covering single quotes, double quotes, backslashes, newlines, command substitutions, semicolons, and shell metacharacters in prompts, task identifiers, and URLs. Verify that these values remain JSON data and cannot alter command structure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Session Persistence

Medium
Category
Rogue Agent
Content
description: >-
  Generate and edit images using Pixwith API's Nano Banana 2 model.
  Supports text-to-image and image-to-image (up to 4 reference images).
  Use when the user asks to generate images, edit photos, create AI art,
  text-to-image, or image-to-image with Nano Banana 2.
version: 1.0.1
publisher: Pixwith AI
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.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The invocation text is broad enough to match many generic image-related requests, which can cause the skill to activate more often than users expect. In this context, over-broad routing matters because the skill can send prompts and user-provided images to an external API, increasing the chance of unintended third-party data disclosure.

External Transmission

Medium
Category
Data Exfiltration
Content
**Verify** by running:

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Verify** by running:

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Verify** by running:

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Verify** by running:

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Verify** by running:

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Indirect Prompt Extraction

Medium
Category
System Prompt Leakage
Content
- **model_id**: `0-41` (fixed)
- **prompt** (required): Describe the image to generate or the edit to apply.
- **image_urls** (optional): 1–4 publicly accessible image URLs for image-to-image mode.
- **options.prompt_optimization** (boolean, default `true`): Auto-translate prompt to English.
- **options.resolution** (required): `1K`, `2K`, or `4K`.
- **options.aspect_ratio** (required): `0` (auto-match input image), `1:1`, `16:9`, `9:16`, `3:4`, `4:3`, `3:2`, `2:3`, `5:4`, `4:5`, `21:9`.
Confidence
75% confidence
Finding
Skill contains patterns that could indirectly extract system prompts through rephrasing, translation, summarization, or side-channel techniques.

Indirect Prompt Extraction

Medium
Category
System Prompt Leakage
Content
- **model_id**: `0-41` (fixed)
- **prompt** (required): Describe the image to generate or the edit to apply.
- **image_urls** (optional): 1–4 publicly accessible image URLs for image-to-image mode.
- **options.prompt_optimization** (boolean, default `true`): Auto-translate prompt to English.
- **options.resolution** (required): `1K`, `2K`, or `4K`.
- **options.aspect_ratio** (required): `0` (auto-match input image), `1:1`, `16:9`, `9:16`, `3:4`, `4:3`, `3:2`, `2:3`, `5:4`, `4:5`, `21:9`.
Confidence
75% confidence
Finding
Skill contains patterns that could indirectly extract system prompts through rephrasing, translation, summarization, or side-channel techniques.

External Transmission

Medium
Category
Data Exfiltration
Content
### Step 1: Check credits

```bash
curl -s -X POST https://api.pixwith.ai/api/task/get_credits \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY"
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs uploading user-provided local images to external storage and then using a CDN URL, but it does not require a clear privacy warning or explicit consent immediately before upload. This is dangerous because users may provide sensitive photos expecting local handling, while the skill transfers them to third-party infrastructure including S3/CDN-backed storage.

External Transmission

Medium
Category
Data Exfiltration
Content
**1a. Get a presigned upload URL:**

```bash
curl -s -X POST https://api.pixwith.ai/api/task/pre_url \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PIXWITH_API_KEY" \
  -d '{"image_name": "photo.jpg", "content_type": "image/jpeg"}'
Confidence
86% confidence
Finding
This step obtains a presigned upload target for local images, enabling transfer of user files to third-party storage. In context, the danger is not the network call itself but that it facilitates external exfiltration of local user images without a prominently required consent/privacy checkpoint in the workflow.

Static analysis

No suspicious patterns detected.