Back to skill

Security audit

ecommerce-image-suite

Security checks for vulnerabilities and agentic risk

Overview

This skill is a plausible ecommerce image generator, but it handles API keys and network destinations too loosely for automatic trust.

Install only if you are comfortable sending product descriptions and prompts to the selected image provider or a configured proxy. Avoid custom base URLs unless you fully trust and control them, use low-privilege provider keys, avoid logging provider-check output, and restrict the skill to a dedicated output directory until endpoint validation, URL-fetch safeguards, key redaction, and type allowlisting are added.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check_providers.py:27
Finding

Provider-check output discloses API key prefixes

Content
View full analysis
5, "key_preview": f"{key[:8]}..." if key else "", "custom_url": url or None, }) return result ``` ### Technical Analysis The provider-check script reads API credentials from environment variables and includes the first eight characters of each credential in its JSON result. The script subsequently prints this structure to standard output. Even a partial secret should not be exposed unless operationally necessary. Command output can be retained in agent transcripts, CI/CD logs, terminal recordings, monitoring platforms, or support bundles. The prefix may identify the provider, credential family, account configuration, or a specific credential when correlated with other leaked information. The declared functionality only requires determining whether a provider is configured. Returning a credential substring exceeds that minimum requirement. ### Attack Path 1. A user or automation environment configures one or more provider API keys. 2. The Skill executes `scripts/check_providers.py`. 3. The script reads each key from the process environment. 4. The first eight characters are inserted into `key_preview`. 5. The resulting JSON is printed to standard output. 6. An actor with access to agent transcripts, build logs, or terminal output obtains the exposed prefixes and correlates them with other credential information. ### Impact Assessment This issue does not directly reveal the entire credential, but it unnecessarily reduces secret confidentiality and entr ...[truncated 218 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate.py:150
Finding

Gemini API key is redundantly transmitted in the request URL

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate.py:279
Finding

Custom endpoints can receive full provider credentials without transport or destination validation

Content
View full analysis
bytes: url = (base_url.rstrip("/") + "/images/generations") if base_url else DEFAULT_URLS["openai"] resp = requests.post( url, headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"}, json={"model": model, "prompt": prompt, "size": "1024x1024", "quality": "hd", "response_format": "b64_json", "n": 1}, timeout=120, ) ``` The same pattern is used for other providers: ```python url = base_url or DEFAULT_URLS["stability"] resp = requests.post( url, headers={"Authorization": f"Bearer {key}", "Accept": "application/json"}, ... ) ``` ### Technical Analysis The `--base-url` argument and provider-specific `*_BASE_URL` environment variables can select an arbitrary destination. The program then sends the complete API key and generated product prompt to that destination. There is no enforcement of HTTPS, no official-host allowlist, no rejection of embedded URL credentials, no restriction against local or private-network destinations, and no explicit confirmation before a provider credential is disclosed to a nonofficial host. Custom proxy support is documented and may be operationally useful. However, transmitting a provider credential to any configured URL without validation exceeds safe minimum privilege and contradicts the ...[truncated 1348 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/generate.py:203
Finding

Provider-controlled image URLs are fetched without SSRF protections

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/generate.py:292
Finding

Unvalidated image type identifiers permit output path traversal

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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (41)

Tainted flow: 'req_url' from os.environ.get (line 146, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The script allows base_url to come from CLI or environment and then sends the provider API key in an Authorization header to that URL. If an attacker can influence configuration, they can redirect requests to an attacker-controlled endpoint and exfiltrate credentials and product data. In this skill context, custom proxy support makes the risk more acute because external transmission is an intended behavior, so misrouting secrets is plausible rather than theoretical.

Content

Scanner excerpt · scripts/generate.py (reported line 149)May include surrounding context.

python
req_url = url
        headers = {"Authorization": f"Bearer {key}", "Content-Type": "application/json"}

    resp = requests.post(
        req_url,
        headers=headers,
        json={

Tainted flow: 'url' from os.environ.get (line 133, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

generate_stability posts the bearer token to a URL that can be sourced from untrusted environment configuration. This creates an SSRF-like credential exfiltration path where the API key and prompt contents are sent to any reachable host. Because this tool is specifically built to transmit product prompts to third-party services, a malicious or misconfigured proxy would directly receive sensitive request data.

Content

Scanner excerpt · scripts/generate.py (reported line 175)May include surrounding context.

python
def generate_stability(key: str, prompt: str, base_url: str = "", model: str = "") -> bytes:
    url = base_url or DEFAULT_URLS["stability"]
    resp = requests.post(
        url,
        headers={"Authorization": f"Bearer {key}", "Accept": "application/json"},
        files={"none": ""},

Tainted flow: 'url' from os.environ.get (line 133, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

generate_tongyi sends authentication and prompt data to a configurable url, enabling credential leakage if DASHSCOPE_BASE_URL or --base-url is attacker-controlled. This is dangerous because the payload includes the full generated prompt, which may contain proprietary product information, and the Authorization header exposes the service credential.

Content

Scanner excerpt · scripts/generate.py (reported line 189)May include surrounding context.

python
def generate_tongyi(key: str, prompt: str, base_url: str = "", model: str = "") -> bytes:
    """通义千问图像生成 — 同步接口(推荐,适用于 qwen-image-2.0-pro 等模型)。"""
    url = base_url or DEFAULT_URLS["tongyi"]
    resp = requests.post(
        url,
        headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
        json={

Tainted flow: 'url' from os.environ.get (line 133, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

generate_doubao trusts a configurable base_url and includes the ARK bearer token in requests to that destination. An attacker who controls configuration can capture the token and all prompts, or pivot requests to internal services. The skill context increases risk because support for custom provider endpoints is documented and encouraged, normalizing potentially unsafe secret forwarding.

Content

Scanner excerpt · scripts/generate.py (reported line 218)May include surrounding context.

python
def generate_doubao(key: str, prompt: str, base_url: str = "", model: str = "") -> bytes:
    """豆包 Seedream(火山方舟)— 使用 ARK_API_KEY 鉴权。"""
    url = base_url or DEFAULT_URLS["doubao"]
    resp = requests.post(
        url,
        headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
        json={

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation claims support for platform-specific sizing and trigger restrictions, but the described implementation does not include trigger-enforcement logic and may use fixed generation defaults while sending user/product content to external image providers. That discrepancy creates a trust gap: users and reviewers may rely on constraints that are not actually enforced, leading to unintended data sharing or incorrect platform outputs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The documentation claims support for platform-specific sizing and trigger restrictions, but the described implementation does not include trigger-enforcement logic and may use fixed generation defaults while sending user/product content to external image providers. That discrepancy creates a trust gap: users and reviewers may rely on constraints that are not actually enforced, leading to unintended data sharing or incorrect platform outputs.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/generate.py (reported line 106)May include surrounding context.

python
f"Keep top-center and bottom corners lighter for text overlay. {quality}"
        ),
    }
    return prompts.get(type_id, f"{desc}. {quality}")


# ── Provider Implementations ────────────────────────────────────────────────

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares access to environment variables, file output, and networked image-generation flows, but it does not define any explicit tool scope such as permissions or allowed-tools. In practice, this makes the capability boundary unclear to reviewers and increases the risk of overbroad execution, especially because the workflow includes reading API-key configuration and writing generated artifacts to disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The platform table hard-codes Chinese for domestic platforms and English for international platforms, which is a natural-language locale policy constraint. The document does not state that users may choose or override the language, so the skill appears to enforce language based solely on platform.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The security statement says API keys are only used to call official endpoints and do not pass through third-party relays, but the same document explicitly supports arbitrary custom base URLs and proxy endpoints. This contradictory guidance can create a false sense of safety and may lead operators to expose API keys and product data to untrusted intermediaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction "Prompt 全程使用英文" requires a specific language for generated output. Under the policy, forcing a language or locale without explicit user choice is a natural-language policy violation unless the constraint is clearly justified or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill hard-codes a 'Young Chinese female model' as the default model specification without requiring user choice or a documented business/legal justification. This creates biased output constraints and can lead to discriminatory or exclusionary generations, especially when the user did not request a specific ethnicity; in an ecommerce-image skill, this is more concerning because it can systematically shape representations across generated marketing assets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file includes natural-language guidance that requires '中文' for Taobao/Tmall copy style. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless clearly justified as region-specific or optional. The entry is phrased as a requirement rather than a user-selectable recommendation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The JD guidance specifies '中文' as the required copy style. This is a natural-language policy concern because it imposes a language choice without stating that the user can choose or that the restriction is optional or consented to.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The line requires '中文' for Pinduoduo copy style. As written, this is a forced language instruction rather than an opt-in or contextual recommendation, which matches the policy's language/locale violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Douyin section prescribes '中文' for the copywriting style. This is a locale/language constraint expressed as a requirement, with no opt-in or user-choice language, so it falls under the policy's prohibited forced-language pattern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Xiaohongshu guidance specifies '中文' as the copywriting language. Because the file presents this as a fixed instruction rather than an optional or justified locale setting, it constitutes a natural-language policy violation under the language-choice rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The Amazon section prescribes '英文' for copy style. This forces a particular language without offering a choice or qualifying it by marketplace locale, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs the skill to send user prompts and bearer API keys to multiple third-party image providers, but it does not warn that product data, prompts, or possibly uploaded content may leave the local environment and be processed by external services. In an ecommerce-image generation context, merchant product details, unreleased marketing assets, or sensitive business data could be disclosed without informed user consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This finding points to the same OpenAI fetch example that performs external transmission of prompt data and uses a bearer token. Although partially duplicative of the prior finding at the same line, the underlying issue remains that external processing is enabled without accompanying security/privacy safeguards.

Content

Scanner excerpt · references/providers.md (reported line 21)May include surrounding context.

Key获取: https://platform.openai.com/api-keys

javascript
const response = await fetch("https://api.openai.com/v1/images/generations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This finding points to the same OpenAI fetch example that performs external transmission of prompt data and uses a bearer token. Although partially duplicative of the prior finding at the same line, the underlying issue remains that external processing is enabled without accompanying security/privacy safeguards.

Content

Scanner excerpt · references/providers.md (reported line 21)May include surrounding context.

Key获取: https://platform.openai.com/api-keys

javascript
const response = await fetch("https://api.openai.com/v1/images/generations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This duplicate line-level finding corresponds to the Stability AI fetch example that sends prompt data externally with an authorization token. Even though it overlaps with another finding, the documented pattern still represents a real privacy and governance risk in a commerce-focused image-generation workflow.

Content

Scanner excerpt · references/providers.md (reported line 84)May include surrounding context.

md
formData.append("aspect_ratio", "1:1");   // "1:1" | "16:9" | "9:16" etc
// formData.append("negative_prompt", "blurry, distorted");

const response = await fetch("https://api.stability.ai/v2beta/stable-image/generate/core", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This duplicate line-level finding corresponds to the Stability AI fetch example that sends prompt data externally with an authorization token. Even though it overlaps with another finding, the documented pattern still represents a real privacy and governance risk in a commerce-focused image-generation workflow.

Content

Scanner excerpt · references/providers.md (reported line 84)May include surrounding context.

md
formData.append("aspect_ratio", "1:1");   // "1:1" | "16:9" | "9:16" etc
// formData.append("negative_prompt", "blurry, distorted");

const response = await fetch("https://api.stability.ai/v2beta/stable-image/generate/core", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This integration submits prompts to DashScope and then fetches result URLs, creating external transmission of user-controlled generation content and follow-on retrieval from provider-hosted resources. In the ecommerce context, this can leak merchant-sensitive campaign or product information to third parties if not transparently disclosed and governed.

Content

Scanner excerpt · references/providers.md (reported line 106)May include surrounding context.

javascript
// Step 1: 提交任务
const submitRes = await fetch(
  "https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis",
  {
    method: "POST",

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This code transmits prompts to Volcengine's image API using a bearer token, which is an external disclosure of user-provided generation content. Because the skill is designed for commercial image creation, prompts may encode sensitive product launch, branding, or merchandising details that users may not expect to be shared externally.

Content

Scanner excerpt · references/providers.md (reported line 159)May include surrounding context.

Key获取: https://console.volcengine.com/ark → API Key管理

javascript
const response = await fetch("https://ark.cn-beijing.volces.com/api/v3/images/generations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:311