Back to skill

Security audit

Kling 3

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent PoYo video-generation helper, but its submit script may expose the PoYo API key through process arguments.

Review before installing. Use this only if you are comfortable sending selected prompts, image URLs, callback URLs, and generation metadata to PoYo. Keep POYO_API_KEY in a protected server-side environment, avoid confidential payloads, and prefer a safer client or revised script that does not place the bearer token in process arguments.

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_kling_3_0.sh:12
Finding
PoYo API Key Exposed Through Process Command-Line Arguments## Vulnerability Details **File Location**: `scripts/submit_kling_3_0.sh`, lines 12–15 **Vulnerability Type**: API credential exposure through process arguments **Risk Level**: Medium ```bash curl --fail-with-body --request POST \ --url "https://api.poyo.ai/api/generate/submit" \ --header "Authorization: Bearer ${POYO_API_KEY}" \ ``` ### Technical Analysis The shell expands `${POYO_API_KEY}` before starting `curl`, placing the complete bearer credential in the process argument vector. Depending on operating-system process visibility and monitoring configuration, command-line arguments may be exposed through process inspection interfaces, diagnostic tools, audit systems, or process telemetry. This implementation also contradicts the explicit security requirement in `SKILL.md` that API keys must not be passed as command-line arguments. Quoting the variable prevents shell word splitting but does not prevent credential exposure in the spawned process's arguments. ### Attack Path 1. A user exports a valid `POYO_API_KEY` and invokes `scripts/submit_kling_3_0.sh` with a payload. 2. The script expands the environment variable into the `--header` argument passed to `curl`. 3. While `curl` is running, a local actor or monitoring component with permission to inspect that process reads its command-line arguments. 4. The actor extracts the bearer token from the `Authorization` header. 5. The stolen token is used to submit unauthorized requests to the PoYo API until it is revoked or expires. Exploitation requires local process-inspection access or access to telemetry that records process command lines. The exposure window may be brief, but repeated or long-running requests increase the opportunity for capture. ### Impact Assessment A successful attacker can obtain the privileges associated with the compromised PoYo API key. This may allow unauthorized video-generation jobs, consumption of account credits, access to API oper ...[truncated 325 chars]
Remediation
## Remediation Suggestions Avoid placing the authorization value directly in `curl` command-line arguments. - Provide sensitive curl options through a protected configuration stream or file rather than ordinary process arguments. - If a temporary configuration file is necessary, create it with restrictive permissions such as mode `0600`, store it in a trusted directory, and remove it reliably with a shell `trap`. - Prefer a client implementation that constructs HTTP headers in process memory without exposing their values through the argument vector. - Ensure shell tracing is disabled around secret handling and verify that errors, debug output, process telemetry, and audit logs do not record authorization headers. - Keep `POYO_API_KEY` in a server-side secret manager or protected environment variable, rotate the currently used key if process arguments may have been collected, and apply the least privileges supported by PoYo. - Add an automated regression check that fails when secret environment variables are interpolated into executable command arguments.
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 (11)

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
82% confidence
Finding
The skill declares shell-capable execution via its metadata and instructions to use curl/scripts, but it does not define an explicit tool scope such as allowed-tools or permissions. That creates unnecessary ambiguity about what execution capabilities the agent may use, increasing the risk of unintended command execution or broader-than-expected tool access in environments that enforce least privilege through manifest scoping.

External Transmission

Medium
Category
Data Exfiltration
Content
## Single-Shot Example

```bash
curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
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
90% confidence
Finding
The script performs a POST request using curl and sends the contents of a user-supplied JSON file to an external API, authenticated with POYO_API_KEY. While the code is straightforward, there is no confirmation prompt, visible user-facing notice, or explanatory comment/docstring warning that local file contents will be transmitted to a remote service.

External Transmission

Medium
Category
Data Exfiltration
Content
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
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
payload_file="$1"

curl --fail-with-body --request POST \
  --url "https://api.poyo.ai/api/generate/submit" \
  --header "Authorization: Bearer ${POYO_API_KEY}" \
  --header "Content-Type: application/json" \
  --data @"${payload_file}"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.