Back to skill

Security audit

Z Image

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward PoYo image-generation helper that clearly sends user-supplied prompts and payloads to PoYo's API, with some credential-handling cautions but no hidden or destructive behavior found.

Install only if you are comfortable sending image prompts and payload data to PoYo. Prefer setting POYO_API_KEY through a protected environment or secret manager, do not pass real API keys as command-line arguments, and use callback_url only with HTTPS endpoints you control.

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
scripts/submit_z_image.sh:4
Finding
Bearer API Key Exposed Through Command-Line Arguments## Vulnerability Details **File Location**: `scripts/submit_z_image.sh`, lines 4–7 **Vulnerability Type**: Command-line secret exposure **Risk Level**: Medium ### Vulnerable Code ```sh api_key="${POYO_API_KEY:-${1:-}}" if [ -z "$api_key" ]; then echo "Usage: submit_z_image.sh [api_key] [payload.json]" >&2 echo "Or set POYO_API_KEY and pass [payload.json]. If no payload file is given, JSON is read from stdin." >&2 ``` ### Technical Analysis The script accepts the PoYo bearer API key as its first positional argument when `POYO_API_KEY` is unset. Secrets supplied on the command line may be recorded in shell history, process-execution logs, terminal auditing systems, or automation logs. Depending on operating-system process visibility and hardening, another local user may also be able to inspect the argument while the process is running. Because the key is subsequently used in the `Authorization` header, disclosure gives an attacker the same PoYo API authorization available to the legitimate key holder. ### Attack Path 1. A user invokes the supported argument-based mode, for example: ```sh scripts/submit_z_image.sh REAL_API_KEY payload.json ``` 2. The plaintext key becomes part of the command line. 3. The command is retained in shell history, captured by monitoring or CI logs, or observed through process inspection. 4. An actor with access to that source extracts the bearer key. 5. The actor sends authenticated requests to the PoYo API using the compromised credential. Exploitation requires access to command history, process metadata, or execution logs; the audited code does not provide remote access to these sources by itself. ### Impact Assessment A successful attacker can act with the API permissions assigned to the exposed PoYo key. This may permit unauthorized image-generation submissions, consumption of account quota or credits, and access to other API operations authorized for that credential. The issue does not directly provide local ...[truncated 88 chars]
Remediation
## Remediation Suggestions 1. Remove positional API-key support and require `POYO_API_KEY` to be supplied through a protected environment or secret manager. 2. Change the initialization to fail unless the environment variable is present: ```sh api_key="${POYO_API_KEY:-}" if [ -z "$api_key" ]; then echo "POYO_API_KEY must be set." >&2 exit 1 fi ``` 3. Update usage documentation so it never recommends placing a real key directly in a command. 4. In CI/CD environments, inject the key through a masked secret facility and prevent secret values from appearing in job logs. 5. Apply least privilege to the API credential and rotate any key previously passed through command-line arguments if command histories or logs may be accessible. 6. Where supported, use short-lived or narrowly scoped credentials and monitor the account for unexpected API usage.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Credential Access

High
Category
Privilege Escalation
Content
Content-Type: application/json
```

Get API keys from <https://poyo.ai/dashboard/api-key>.

Recommended skill env var:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill explicitly instructs use of shell-accessible tooling (`curl`) and a submission script, but it does not declare any `permissions` or `allowed-tools` scope. This creates an authorization gap where an agent may invoke shell/network capabilities without explicit confinement, increasing the risk of unintended command execution or outbound requests beyond what the user expects.

External Transmission

Medium
Category
Data Exfiltration
Content
## Submission example

```bash
curl -sS https://api.poyo.ai/api/generate/submit   -H 'Authorization: Bearer YOUR_API_KEY'   -H 'Content-Type: application/json'   -d '{
  "model": "z-image",
  "callback_url": "https://your-domain.com/callback",
  "input": {
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
body=$(cat)
fi

curl -sS https://api.poyo.ai/api/generate/submit   -H "Authorization: Bearer $api_key"   -H 'Content-Type: application/json'   -d "$body"
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This shell script performs a network transmission to an external service using `curl`, sending the JSON body and an Authorization header. Apart from usage syntax, there is no confirmation prompt, print/log message, or comment/docstring warning the user that input data will be transmitted to `api.poyo.ai`.

Missing User Warnings

Low
Confidence
81% confidence
Finding
This markdown file documents use of an Authorization bearer token and recommends storing it in an environment variable, but it does not include any warning about protecting the API key or avoiding accidental exposure. Because SQP-2 applies to markdown files when descriptions omit warnings about privacy or system-integrity-impacting behavior, the lack of disclosure around credential handling is a quality/safety gap.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The file documents an optional `callback_url` and later states that PoYo will send POST callbacks when tasks complete, but it does not warn that generated-result metadata or outputs may be sent over the network to that endpoint. For markdown skills, SQP-2 calls for warnings when behavior could affect privacy or system integrity, and outbound callbacks merit explicit disclosure.

Static analysis

No suspicious patterns detected.