Back to skill

Security audit

Seedance Video Generation BytePlus

Security checks for vulnerabilities and agentic risk

Overview

This video-generation skill mostly does what it says, but it includes an avoidable local command-execution risk when downloaded videos are opened on macOS.

Install only if you are comfortable sending prompts and chosen images to BytePlus and, if used, sending generated videos through Feishu. Avoid using sensitive images or confidential prompts, keep ARK_API_KEY scoped and rotated, and do not use the macOS auto-open download path until the helper replaces os.system with a non-shell file-opening call.

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
seedance_byteplus.py:232
Finding
Shell Command Injection Through Unsanitized Download Path<![CDATA[ ## Vulnerability Details **File Location**: `seedance_byteplus.py`, lines 232–242 **Vulnerability Type**: OS command injection **Risk Level**: Medium ### Vulnerable Code ```python download_path = Path(download_dir).expanduser() download_path.mkdir(parents=True, exist_ok=True) filename = f"seedance_{task_id}_{int(time.time())}.mp4" filepath = download_path / filename print(f"\nDownloading video to {filepath}...") try: urllib.request.urlretrieve(video_url, str(filepath)) print(f"Saved to: {filepath}") # Open on macOS if sys.platform == "darwin": os.system(f'open "{filepath}"') ``` ### Technical Analysis The generated file path is interpolated directly into a command passed to `os.system()`. This function invokes a system shell, causing shell metacharacters and command substitutions in `filepath` to be interpreted rather than treated as literal path characters. The path contains two insufficiently trusted values: - `download_dir`, supplied through the `--download` command-line option. - `task_id`, obtained from the remote API response and incorporated into the filename. Wrapping the path in double quotes does not prevent shell command substitution. For example, a download directory containing `$(malicious-command)` remains executable inside double quotes on a POSIX shell. Opening a file does not require shell interpretation. Consequently, invoking a shell exceeds the minimum privileges and execution capabilities needed for the declared functionality. ### Attack Path 1. An attacker influences an Agent or user to invoke the CLI on macOS with a crafted `--download` path, such as a path containing shell command substitution. 2. Alternatively, compromise or manipulation of the API response could provide a maliciously formed task ID. 3. The Skill creates the video-generation task and waits until its status is `succeeded`. 4. The generated video is downloaded to a path derived from the crafted value. 5. The path is interpol ...[truncated 1149 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Eliminate shell invocation and pass arguments directly to the operating-system utility: ```python import subprocess if sys.platform == "darwin": try: subprocess.run( ["/usr/bin/open", str(filepath)], check=False, shell=False, ) except OSError as e: print(f"Unable to open downloaded video: {e}", file=sys.stderr) ``` Additional hardening measures: 1. Validate `task_id` against the exact format documented by BytePlus before using it in a filename. A conservative fallback is to allow only letters, digits, underscores, and hyphens. 2. Generate the local filename independently of remote values, such as with `uuid.uuid4()`, while retaining the task ID only as metadata. 3. Treat `--download` as a filesystem path only and never interpolate it into shell commands. 4. Resolve the destination path and verify that it remains within an intended download directory if the surrounding Agent imposes workspace confinement. 5. Add regression tests using paths containing spaces, quotes, dollar signs, backticks, semicolons, and command-substitution syntax to verify that no shell interpretation occurs. 6. Avoid replacing `os.system()` with `subprocess.run(..., shell=True)`, because that would preserve the command-injection risk. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (35)

External Script Fetching

High
Category
Supply Chain
Content
## Execution (Recommended: Python CLI Tool)

A Python CLI tool is provided at `~/.claude/skills/seedance-video-byteplus/seedance_byteplus.py` for robust execution with proper error handling, automatic polling, and local image base64 conversion. **Prefer using this tool over raw curl commands.**

### Quick Examples with Python CLI
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
```bash
echo "Waiting for video generation to complete..."
while true; do
  STATUS_RESULT=$(curl -s -X GET "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks/${TASK_ID}" \
    -H "Authorization: Bearer $ARK_API_KEY")

  STATUS=$(echo "$STATUS_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin)['status'])")
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
### Query Task Status

```bash
curl -s -X GET "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks/${TASK_ID}" \
  -H "Authorization: Bearer $ARK_API_KEY" | python3 -m json.tool
```
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
```bash
# List all tasks (paginated)
curl -s -X GET "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks?page_num=1&page_size=10" \
  -H "Authorization: Bearer $ARK_API_KEY" | python3 -m json.tool

# Filter by status
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
-H "Authorization: Bearer $ARK_API_KEY" | python3 -m json.tool

# Filter by status
curl -s -X GET "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks?page_num=1&page_size=10&filter.status=succeeded" \
  -H "Authorization: Bearer $ARK_API_KEY" | python3 -m json.tool
```
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
### Cancel or Delete Task

```bash
curl -s -X DELETE "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks/${TASK_ID}" \
  -H "Authorization: Bearer $ARK_API_KEY"
```
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Exfiltration Commands

High
Category
Prompt Injection
Content
[Video binary data]
```

**c) Send Message to Feishu Chat**

```
POST https://open.feishu.cn/open-apis/im/v1/messages/send
Confidence
90% confidence
Finding
This section documents a workflow that sends file content and metadata to an external messaging platform, which matches an exfiltration pattern because local data is intentionally moved off-host. While the feature appears product-intended rather than covertly malicious, in an agent environment it is still security-relevant because it enables outbound transfer of generated or arbitrary local files to a remote recipient.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
Automatically opening a downloaded file on macOS performs a local side effect unrelated to the minimum needed for video generation. Even aside from the shell issue, auto-launching content from a remote URL can expose users to unsafe file handling or unexpected execution chains through associated applications.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Content
# Open on macOS
                    if sys.platform == "darwin":
                        os.system(f'open "{filepath}"')
                except Exception as e:
                    print(f"Download failed: {e}", file=sys.stderr)
Confidence
95% confidence
Finding
The code invokes a shell via os.system() using a path-derived string. Although the filename is internally constructed and task_id likely comes from the remote API, shell execution is unnecessary here and creates command-injection risk if the path or filename ever contains shell-significant characters or if future changes make filepath more user-controlled.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The README repeatedly instructs users to submit prompts, local images, and task metadata to the BytePlus Ark API, but it does not prominently warn that this content is transmitted to a third-party service. In a skill that encourages use of personal/local files and natural-language prompts, that omission can lead users to disclose sensitive data without informed consent.

Session Persistence

Medium
Category
Rogue Agent
Content
### 1. Get Your API Key

Sign up at [BytePlus ModelArk Console](https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey) and create an API Key.

### 2. Set Environment Variable
Confidence
82% confidence
Finding
The README directs users to store a long-lived API key in the shell environment, which can persist for the session and may be exposed to subprocesses, shell history workflows, debugging output, or multi-user environments if handled carelessly. While common practice, it increases the blast radius of credential leakage for a third-party paid API.

Skill Enumeration

Medium
Category
Agent Snooping
Content
Copy the skill folder to your Claude Code skills directory:

```bash
mkdir -p ~/.claude/skills/seedance-video-byteplus
# Copy SKILL.md and seedance_byteplus.py to the directory
```
Confidence
85% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Session Persistence

Medium
Category
Rogue Agent
Content
Generate a video from a text prompt with default settings (720p, 16:9, 5 seconds, with audio).

```bash
python3 ~/.claude/skills/seedance-video-byteplus/seedance_byteplus.py create \
  --prompt "A golden retriever running through a field of sunflowers at sunset, cinematic lighting" \
  --wait --download ~/Desktop
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

External Transmission

Medium
Category
Data Exfiltration
Content
--wait --download ~/Desktop
```

**curl equivalent:**
```bash
curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
Confidence
95% confidence
Finding
The curl example explicitly sends user prompts and authorization credentials to an external BytePlus endpoint, which is core functionality but still an external transmission risk. This becomes security-relevant because users may paste sensitive prompts or supply local/private images without a conspicuous warning about third-party transfer.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill declares no explicit tool scope even though it clearly expects access to environment variables, shell execution, and outbound network calls. Missing scope boundaries can cause an agent platform to grant broader capabilities than necessary and makes risky behaviors less visible to users and reviewers.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill does not clearly warn that prompts, task metadata, image URLs, and local image contents may be transmitted to BytePlus, nor that generated videos may be downloaded and opened locally. This creates a meaningful privacy and consent risk because users may provide sensitive prompts or files without understanding the external transfer and local execution side effects.

External Transmission

Medium
Category
Data Exfiltration
Content
## Execution (Recommended: Python CLI Tool)

A Python CLI tool is provided at `~/.claude/skills/seedance-video-byteplus/seedance_byteplus.py` for robust execution with proper error handling, automatic polling, and local image base64 conversion. **Prefer using this tool over raw curl commands.**

### Quick Examples with Python CLI
Confidence
94% confidence
Finding
The skill is explicitly designed to send user prompts and possibly media to the external BytePlus API, so the transmission itself is expected. However, it remains a real security/privacy issue because the skill lacks strong disclosure and consent language around what data leaves the local environment.

Session Persistence

Medium
Category
Rogue Agent
Content
### Quick Examples with Python CLI

```bash
# Text-to-video (create + wait + download)
python3 ~/.claude/skills/seedance-video-byteplus/seedance_byteplus.py create --prompt "A kitten yawning at the camera" --wait --download ~/Desktop

# Image-to-video from local file
Confidence
78% confidence
Finding
The workflow encourages creating, waiting for, downloading, and storing generated videos locally, which creates session persistence and residual data on disk. While expected for a file-generation skill, this becomes risky when the skill does not clearly communicate retention, storage location, or cleanup expectations.

External Transmission

Medium
Category
Data Exfiltration
Content
**With image URL:**
```bash
TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
95% confidence
Finding
This example sends prompt text and an image URL to an external BytePlus endpoint. In context that is the core function of the skill, but it still exposes user-supplied data to a third party and therefore requires clear notice and constrained execution.

External Transmission

Medium
Category
Data Exfiltration
Content
IMG_BASE64=$(base64 < "$IMG_PATH" | tr -d '\n')
IMG_DATA_URL="data:image/${IMG_EXT_LOWER};base64,${IMG_BASE64}"

TASK_RESULT=$(curl -s -X POST "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{
Confidence
97% confidence
Finding
This example converts a local image file to base64 and transmits the full file contents to the BytePlus API. That is more sensitive than a plain URL because it can exfiltrate local user data directly from disk to a third party if used on private images without informed consent.

Static analysis

No suspicious patterns detected.