Back to skill

Security audit

zimage

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill does what it claims, but its helper scripts store and load the API key in a way users should review before installing.

Install only if you trust the Z-Image provider with your prompts and API usage. Prefer setting X_API_KEY for the session or using a dedicated, revocable key rather than the plaintext ~/.config/z-image/.env helper; avoid confidential prompts and remove or rotate the key when no longer needed.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The guide instructs callers to send user prompts and an x-api-key to a third-party remote endpoint, but it provides no warning that user content leaves the local system or that the credential is sensitive. In an agent-skill context, this can cause unintentional disclosure of user data and unsafe handling of secrets because the skill normalizes external transmission without consent or disclosure.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script writes the provided API key in plaintext to a persistent file under the user's home directory without any advance warning, confirmation, or discussion of the security implications. Although chmod 600 reduces exposure to other local users, the credential remains accessible to the current user context, shell backups, filesystem snapshots, and any malware or later process compromise on that account.

Credential Access

High
Category
Privilege Escalation
Content
exit 1
fi

if [[ -z "${X_API_KEY:-}" && -f "$HOME/.config/z-image/.env" ]]; then
  set -a
  . "$HOME/.config/z-image/.env"
  set +a
Confidence
88% confidence
Finding
The script sources ~/.config/z-image/.env with the shell '.' command, which executes the file as Bash code rather than safely parsing key-value pairs. If that file is modified by another local process or attacker, arbitrary commands would run with the user’s privileges when the skill executes.

Credential Access

High
Category
Privilege Escalation
Content
if [[ -z "${X_API_KEY:-}" && -f "$HOME/.config/z-image/.env" ]]; then
  set -a
  . "$HOME/.config/z-image/.env"
  set +a
fi
Confidence
90% confidence
Finding
The combination of 'set -a' and sourcing a user-controlled .env file increases risk because every assignment in that file is exported and any embedded shell code is executed. In an agent skill context, this makes local credential loading more dangerous than necessary because a simple config file becomes a code execution surface.

Static analysis

No suspicious patterns detected.