Back to skill

Security audit

Photo Pack Generator

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent photo-pack generator, but it under-discloses external face-photo uploads and ships a shell script with unsafe input handling that can execute unintended commands.

Review this before installing. Only use it with face images you are comfortable uploading to an external image service, avoid passing untrusted values into script options such as --num, and avoid --view unless the download and local file write behavior is acceptable. The issues look like security and disclosure gaps rather than clear malicious intent.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate-pack.sh:25
Finding

Command Injection Through Unvalidated Arithmetic Input

Content
View full analysis
${#PROMPTS[@]} ? ${#PROMPTS[@]} : NUM_IMAGES)) ``` ### Technical Analysis The value supplied through `--num` is stored without validating that it is a decimal integer. It is subsequently evaluated inside a Bash arithmetic expansion. Bash arithmetic expansion treats variable values as arithmetic expressions rather than strictly as numeric strings. Arithmetic expressions can trigger recursive variable and array-subscript evaluation. A crafted value containing an array reference with a command substitution can therefore cause Bash to execute an operating-system command while evaluating `LIMIT`. Quoting the value when assigning it to `NUM_IMAGES` does not prevent this issue because the dangerous interpretation occurs later, during arithmetic evaluation. ### Attack Path 1. An attacker supplies a crafted value for the requested image count. 2. An agent or user passes that value to the documented `--num` option. 3. The argument parser stores the complete value in `NUM_IMAGES`. 4. Line 190 evaluates `NUM_IMAGES` as part of a Bash arithmetic expression. 5. Bash processes attacker-controlled arithmetic syntax, including any command substitution reachable through recursive array-subscript evaluation. 6. The injected command executes with the operating-system privileges and environment of the skill process. A representative malicious input would use an arithmetic array subscript containing a command substitution, rather than a legitimate integer. ### Impact Assessment Successful exploitation provides arbitrary command execution under the account running the skill. Depending on that account's permissions, an attacker could: - Read or modify files accessible to the agent. - Access credent ...[truncated 500 chars]
Remediation
View remediation
&2 exit 1 fi if (( 10#$NUM_IMAGES > 100 )); then echo "Error: --num must not exceed 100." >&2 exit 1 fi NUM_IMAGES=$((10#$NUM_IMAGES)) ``` The `10#` prefix forces decimal interpretation and avoids unintended octal handling. A conservative upper bound also limits resource consumption. Additional hardening should include: - Rejecting missing option values instead of blindly reading `$2`. - Enabling strict shell behavior where compatible: ```bash set -euo pipefail ``` - Using a dedicated argument parser or validation function for every parameter. - Running the script with the minimum filesystem and network privileges required. - Adding regression tests with nonnumeric, negative, oversized, and arithmetic-expression inputs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate-pack.sh:207
Finding

Unvalidated Upstream URL Download Enables Arbitrary Resource Fetching

Content
View full analysis
&2 curl -s -o "$TEMP_FILE" "$URL" LOCAL_FILES+=("$TEMP_FILE") fi ``` ### Technical Analysis When `--view` is enabled, the script extracts `.outputs[0]` from the external generation helper's JSON response and passes it directly to `curl`. It does not validate: - The URL scheme. - The destination hostname. - Whether the host is the expected MuAPI CDN. - Redirect destinations. - Response size or content type. - HTTP or transport errors. - Whether `.outputs[0]` is a valid nonempty string. Consequently, a compromised generation service, modified host helper, malicious intermediary, or malformed upstream response can direct the client to fetch an unintended resource. Depending on the protocols supported by the installed curl build, this can include internal HTTP services or local-resource schemes. The filename extension is also derived directly from the untrusted URL rather than from a validated content type or fixed allowlist. This can create malformed paths and misleading file types. ### Attack Path 1. The skill invokes the external `generate-image.sh` helper and receives JSON in `GEN_OUTPUT`. 2. An upstream component returns an attacker-controlled value in `.outputs[0]`. 3. The user has enabled the `--view` option. 4. The script extracts the malicious URL without validating its scheme or hostname. 5. `curl` requests the supplied location using the skill runner's network position and permission ...[truncated 1123 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill includes shell execution behavior (bash scripts/generate-pack.sh ...) but does not declare any tool scope or allowed tools in metadata. This creates an authorization and review gap: an agent/runtime may permit command execution without explicit least-privilege declaration, making risky local command use easier to miss and harder to constrain.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs execution of a shell command against a local file path (--image "./my_face.jpg") without user-facing warning or safety guidance around command execution, local file access, or path handling. In an agent setting, this can normalize unsandboxed shell use on user-provided inputs and local files, increasing risk of unintended file access, unsafe path interpolation, or execution in environments with broader filesystem permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When a local file is provided, the script automatically uploads it via an external helper and replaces the local path with a remote URL, but the script exposes no clear consent or warning mechanism about this data transfer. In a photo-identity skill, this is more sensitive than usual because users are likely to provide biometric face images, so silent external transmission creates a meaningful privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

With --view enabled, the script silently downloads generated images from returned URLs and writes them into a local output directory before optionally opening them. This is lower severity than the upload issue, but it still causes unexpected local file writes and network retrieval without clear disclosure, which can surprise users and create privacy or storage concerns on shared systems.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.