Back to skill

Security audit

ai-image-gen-free

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill is incomplete and asks users to run an unspecified script with an API key, so it needs review before installation.

Install only if you are comfortable providing an API key and prompts to the configured external service, and do not run substituted scripts or elevate the agent to administrator unless you have independently reviewed the exact implementation. Use a limited API key, a non-sensitive prompt, and a dedicated writable output directory.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:31
Finding

Overbroad Tool Access and Unsafe Administrator-Level Execution Guidance

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31-34 and 356
Vulnerability Type: Least-privilege violation and unsafe privilege guidance
Risk Level: Medium

Vulnerable Configuration

yaml
tools:
  - read
  - exec
  - write

Line 356 additionally advises users whose current account lacks read or write permission to check permissions and run the operation as an administrator.

Technical Analysis

The skill requests general read, write, and command-execution capabilities, even though its legitimate purpose is limited to submitting an image-generation prompt and saving one output image. No executable implementation is included that would justify unrestricted access to these tools.

The troubleshooting guidance compounds this excessive permission model by recommending administrator-level execution when file access fails. Elevating the entire Agent or terminal is not an appropriate general remedy for an output-directory permission problem. It expands the security boundary of every subsequently executed command rather than granting narrowly scoped access to the intended output location.

This does not independently prove malicious behavior, but it creates a dangerous execution environment in which a substituted script, manipulated command, or unsafe output path could operate with privileges beyond those necessary for image generation.

Attack Path

  1. A user invokes the skill to generate an image.
  2. The unresolved script command or output operation fails because the selected directory is not writable.
  3. Following the troubleshooting guidance, the user reruns the Agent or terminal with administrator privileges.
  4. The skill still requires an external or substituted script because no implementation is packaged.
  5. If that script or its arguments are malicious or compromised, it executes through the declared exec capability with administrator privileges.
  6. The process can then read ...[truncated 743 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the read capability unless image generation demonstrably requires reading a user-selected input file.
  2. Replace unrestricted command execution with a narrowly scoped tool or a fixed, packaged executable.
  3. Restrict writes to a caller-approved output path or a dedicated application output directory.
  4. Remove the recommendation to run as an administrator.
  5. For permission errors, instruct users to select a writable directory or correct ownership and permissions only on the intended output directory.
  6. Reject output paths that resolve outside the approved directory, including paths containing traversal components or symbolic-link escapes.
  7. Run image-generation processing in a sandbox with no access to unrelated user or system files.
  8. Document the minimum permissions required by each operation.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:70
Finding

Credentialed External API Use Cannot Be Audited Because the Referenced Implementation Is Missing

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 42, 70, and 83-90
Vulnerability Type: Unverifiable credential handling and incomplete executable configuration
Risk Level: Medium

Vulnerable Configuration

bash
export IMAGE_GEN_BASE_URL="https://code.newcli.com/ai-model"

The documented invocation is structurally equivalent to:

bash
python3 <script from the skill directory> "your prompt" --output output.png

However, the audited package contains only SKILL.md; the referenced Python script is absent.

Technical Analysis

The skill instructs users to configure an API key, connect to https://code.newcli.com/ai-model, and execute a Python script from the skill directory. The package does not contain that script. Consequently, the audit cannot verify:

  • How the API key is attached to requests.
  • Whether the key, prompt, response, or error body is logged.
  • Whether the configured base URL is validated against an allowlist.
  • Whether redirects are followed to untrusted destinations.
  • Whether TLS certificate validation remains enabled.
  • Whether API responses are authenticated and safely decoded.
  • Whether output paths are validated before files are written.
  • Whether generated files or metadata contain sensitive information.

The documentation also uses Gemini and generic “ai-model” branding while configuring a newcli.com endpoint. The available files do not establish the endpoint's ownership or its relationship to the named model provider. This mismatch is not proof that the endpoint is malicious, but it prevents users from making a well-supported trust decision before transmitting credentials and prompts.

Because the implementation is missing, users must obtain, create, or substitute executable code to make the skill operational. That creates a supply-chain gap: the substituted code receives the API key through the environment and operates with the skill's netwo ...[truncated 1780 chars]

Remediation
View remediation

Remediation Suggestions

  1. Include the exact executable implementation in the reviewed package rather than referring to an unspecified script.
  2. Document the endpoint operator, privacy policy, data-retention behavior, and relationship to the advertised model provider.
  3. Pin the default endpoint to an authenticated, documented service and enforce an explicit hostname allowlist.
  4. Reject URLs containing user information, non-HTTPS schemes, unexpected ports, or hosts outside the allowlist.
  5. Disable cross-origin credential forwarding during redirects, or reject redirects entirely for authenticated requests.
  6. Preserve normal TLS certificate and hostname validation.
  7. Pass credentials only through an authorization header or another documented mechanism; never place them in URLs, command-line arguments, logs, exception messages, image metadata, or result objects.
  8. Add automated tests demonstrating that secrets are redacted from standard output, standard error, logs, and generated metadata.
  9. Validate model identifiers and output paths against strict allowlists.
  10. Pin any dependencies used by the implementation and provide integrity hashes or a lock file so the executable supply chain can be audited.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill invokes an external image-generation API but does not clearly warn users that their prompts and related request data will be transmitted off-platform. Prompts may contain sensitive business, personal, or regulated information, so the lack of disclosure can lead to unintended data sharing and privacy/compliance issues.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill states that API keys must never be accepted, echoed, or stored from chat input, but nearby instructions tell users to provide necessary input parameters in the AI Agent conversation without clearly excluding secrets. In a chat-based agent context, this contradiction can cause users or downstream implementers to pass API keys through the conversation channel, increasing the risk of secret exposure in prompts, logs, traces, or model context.

Content

No source excerpt is available for this finding.