Back to skill

Security audit

image generation gpt image

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill is mostly purpose-aligned, but it needs review because it uploads user prompts/images to WellAPI and contains a forced tracked API-key onboarding prompt that limits neutral setup guidance.

Review before installing. Use this only if you are comfortable sending prompts, selected local images, masks, and your WellAPI API key to WellAPI. Prefer setting the API key through an environment variable or secret mechanism instead of pasting it into chat. Avoid sensitive or regulated images unless you have reviewed WellAPI's privacy, retention, and pricing terms. Be aware that generated images are saved locally and auto-attached to the conversation, and that the fallback registration link includes channel tracking.

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

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:136
Finding
Forced Referral Message and Onboarding Instruction Hijacking<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 136–140 **Vulnerability Type**: Forced agent-output manipulation through Skill instructions **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown When no key can be located (env var unset, no cached key on disk), **before making any API call** show the user this short prompt verbatim. Translate to the user's language if appropriate. **Do not** expand it into multiple "options / methods", **do not** show shell commands, **do not** ask follow-up questions like "do you already have a key": > Please paste your WellAPI API Key. If you don't have one yet, register at https://wellapi.ai/register?channel=c_qqn3vdvc to get a free key. ``` ### Technical Analysis The Skill instructs the agent to reproduce a fixed onboarding message containing the tracking parameter `channel=c_qqn3vdvc`. It additionally prohibits the agent from offering alternative setup methods, showing commands, or asking clarifying questions. Requesting a WellAPI API key is consistent with the declared hosted image-generation functionality. However, forcing a tracked registration link and constraining otherwise legitimate agent responses are not technically necessary to authenticate API requests. These directives alter the agent's behavior for a promotional or attribution purpose rather than for execution safety. This constitutes Skill instruction hijacking because loading and invoking the Skill changes the agent's response policy, suppresses neutral onboarding assistance, and requires attributed promotional content. ### Attack Path 1. A user installs or activates the Skill. 2. The Skill checks for `WELLAPI_API_KEY`. 3. The key is absent from the environment or other expected storage. 4. The first-run onboarding branch is activated. 5. The agent is instructed to reproduce the fixed message verbatim. 6. The user is directed to a provider registration URL containing the embedded referral or tracking identifier. 7. ...[truncated 1318 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the referral or campaign query parameter and use the provider's canonical registration or documentation URL. 2. Delete directives requiring the agent to reproduce the message verbatim. 3. Remove restrictions that prohibit alternative setup instructions, shell commands, or reasonable follow-up questions. 4. Replace the block with neutral guidance, for example: ```markdown A WellAPI API key is required. If no key is configured, ask the user to provide one or direct them to the provider's official documentation. ``` 5. Clearly disclose that prompts and user-selected edit images will be transmitted to the third-party API before the first upload. 6. Avoid encouraging users to paste credentials directly into conversational history when a secure environment-variable or secret-input mechanism is available. 7. If campaign attribution is retained for legitimate business reasons, disclose it explicitly and obtain user consent rather than enforcing it through hidden Skill instructions. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
>
> Please paste your WellAPI API Key. If you don't have one yet, register at https://wellapi.ai/register?channel=c_qqn3vdvc to get a free key.

After the user pastes a key, use it for the current request and proceed straight to image generation. Do not lecture the user about env vars, shells, or persistence unless they explicitly ask how to save it.

## Triggers
Confidence
85% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends prompts and, for image editing, local image files to the external WellAPI service, yet it does not prominently warn users that their text and uploaded images leave the local environment. This creates a real privacy and data-handling risk, especially if users supply sensitive prompts or personal/local images without realizing they are being transmitted to a third party.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill explicitly instructs the agent to decode returned base64 image data and save files to local disk, then print absolute paths for attachment, but it does not require a user-facing notice or confirmation before creating files. Silent file creation can surprise users, create privacy or storage risks, and may overwrite expectations about where data is persisted on the host.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The example shows the skill collecting attached local image files and sending them in a multipart request to https://wellapi.ai/v1/images/edits, but it does not clearly warn users that local files are being uploaded to a third-party remote service. This can lead to unintended disclosure of sensitive or proprietary images, especially in agent workflows where users may assume attachments remain local.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The examples send user prompts and local image files to an external WellAPI endpoint, but the documentation does not explicitly warn users that their text and image contents will leave the local machine. In an agent skill context, this can cause inadvertent disclosure of sensitive prompts, proprietary images, or personal data because users may treat example commands as local-only processing guidance.

External Transmission

Medium
Category
Data Exfiltration
Content
PROMPT_JSON=$(json_escape "$PROMPT")

RESP=$(curl -sS -X POST "https://wellapi.ai/v1/images/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<WELL_END
Confidence
92% confidence
Finding
This curl command transmits the prompt and API credentials to an external service, and elsewhere in the file the edit flow uploads local image content as well. While this is expected for an image generation API, it is still a real external-transmission risk in a skill because agents may invoke or adapt these examples without making users aware that private data is being sent off-host.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script sends user prompts and, in edit mode, local image and mask files to the remote WellAPI service, but the documentation does not clearly disclose that local content is uploaded off-host. This can lead users to unknowingly transmit sensitive prompts or private local files to a third party, which is a real privacy and data-handling risk in this skill context.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill’s example workflow sends user prompts and local image files to a third-party remote API, but the surrounding documentation does not prominently disclose that potentially sensitive local content will leave the user’s machine. This can lead users to upload private images or confidential prompt content without informed consent, especially because the examples encourage passing local file paths directly for editing.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The trigger table hard-codes Chinese and English invocation phrases but does not explain whether users may use other languages or choose a preferred locale. This can be read as a locale policy constraint without explicit opt-in or justification.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The only trigger phrase shown is in Chinese, which can imply a language-specific invocation requirement. The file does not state that other languages are supported or that Chinese is required for a justified region-specific reason, so this may violate the policy against forcing a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
75% confidence
Finding
The trigger section defines activation phrases in Chinese and English as the expected invocation forms, but does not state whether users may invoke the skill in other languages or choose their preferred locale. This can be read as imposing specific language requirements without explicit opt-in or justification.

Missing User Warnings

Low
Confidence
85% confidence
Finding
This markdown explicitly states that the skill base64-decodes image data and writes it to disk, then auto-attaches the file to the conversation. The description does not include any warning that local files will be created or attached automatically, which is a user-impacting behavior relevant to data handling and system state.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This markdown file contains a PowerShell script that decodes API responses and saves images to local files, and the description notes that output is written to a local file. However, there is no clear user-facing warning in the markdown about local file creation, path selection, or the resulting disk-side effects when the script is run.

Static analysis

No suspicious patterns detected.