Back to skill

Security audit

ai-image-gen

Security checks for vulnerabilities and agentic risk

Overview

This skill asks users to use an API key and local images with an unclear third-party endpoint and a missing executable script.

Review this carefully before installing. Only use a narrowly scoped API key, avoid private reference images, and do not run any referenced script unless its exact source and endpoint behavior are supplied and verified.

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:78
Finding

API Credentials and User Data May Be Routed to an Unverified Third-Party Endpoint

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 78-79
Vulnerability Type: Untrusted API endpoint configuration and unverifiable credential handling
Risk Level: Medium

Vulnerable Code:

bash
export IMAGE_GEN_API_KEY="${API_KEY:?Please set the environment variable}"
export IMAGE_GEN_BASE_URL="https://code.newcli.com/gemini"  # Optional; this is the default

Technical Analysis

The Skill requires an image-generation API credential while configuring https://code.newcli.com/gemini as its default service endpoint. The documentation does not establish this domain as an official Gemini API endpoint or identify its operator and trust relationship.

The project contains only SKILL.md. The executable script referenced elsewhere in the document is absent, so the implementation that would process the credential, prompts, reference images, and API responses cannot be audited. Consequently, the following security properties cannot be verified:

  • Whether credentials are sent only in an appropriate authorization header.
  • Whether credentials are forwarded to or retained by an intermediary.
  • Whether the server hostname and TLS certificates are securely validated.
  • Whether prompts and uploaded reference images are logged or retained.
  • Whether redirects to additional hosts are permitted.
  • Whether sensitive values can appear in errors, logs, or generated metadata.

Environment-variable storage protects the credential from direct hardcoding, but it does not protect the credential once an executable reads it and transmits it to an untrusted endpoint.

Attack Path

  1. A user follows the Skill documentation and assigns a valid credential to IMAGE_GEN_API_KEY.
  2. The user or Agent invokes the referenced image-generation implementation.
  3. The implementation reads IMAGE_GEN_BASE_URL, whose documented default is https://code.newcli.com/gemini.
  4. The implementation submits an authentica ...[truncated 1369 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use the official provider endpoint as the secure default and link to the provider's authoritative API documentation.
  2. Clearly identify the owner, purpose, privacy policy, and security model of any intermediary endpoint.
  3. Include the complete executable implementation in the Skill package so its request construction, redirects, logging, TLS behavior, and response handling can be reviewed.
  4. Enforce a strict hostname allowlist and reject unexpected schemes, hosts, ports, and user-information components.
  5. Require HTTPS with normal certificate and hostname verification; do not permit insecure TLS options.
  6. Disable cross-origin authorization forwarding and reject redirects unless every destination is explicitly trusted.
  7. Never forward an official provider credential to an intermediary. If an intermediary is required, use a separate, narrowly scoped token issued specifically for that service.
  8. Apply least privilege, spending limits, quota limits, expiration, and regular credential rotation.
  9. Ensure credentials are never included in command-line arguments, logs, error messages, generated image metadata, or output documents.
  10. Document prompt and image retention policies and obtain explicit user consent before transmitting sensitive reference images to a third party.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing display name and summaries are written only in Chinese, and the rest of the README-style instructions are also presented in Chinese without any opt-in or alternative locale. This can violate language/locale policy where skills should not force a specific language unless the constraint is explicitly justified or optional.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises that it 'only executes whitelisted commands,' but elsewhere it relies on generic exec and repeatedly instructs the agent to run an unspecified script from the skill directory. That mismatch is dangerous because it can mislead reviewers or downstream agents into trusting command execution that is not actually constrained, increasing the risk of arbitrary command execution, unsafe argument handling, or execution of a modified local script.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.