Back to skill

Security audit

Doubao Image Video Skill V2

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but it promotes watermark removal and gives unsafe API-key handling instructions that could expose the user's Volcengine account.

Install only after review. Use a restricted, rotatable Volcengine ARK key, do not paste or share full ARK_API_KEY values, avoid storing the key in common shell startup files when a safer secret store is available, and assume prompts, image URLs, task metadata, and generated media URLs are sent to Volcengine. Do not use the watermark-removal examples unless you own the content or have explicit authorization, and avoid exposing this wrapper to untrusted prompts until JSON encoding is fixed.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/doubao.sh:90
Finding
Unescaped User Input Allows JSON Request-Body Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/doubao.sh:90-98`, `scripts/doubao.sh:140-149`, and `scripts/doubao.sh:196-225` **Vulnerability Type**: Improper encoding of user-controlled data in JSON request bodies **Risk Level**: Medium ### Vulnerable Code ```bash # Image generation local payload=$(cat <<EOF { "model": "doubao-seedream-3-0-t2i-250415", "prompt": "${prompt}", "n": 1 } EOF ) ``` ```bash # Image editing local payload=$(cat <<EOF { "model": "doubao-seedream-4-0-250828", "image": "${image_url}", "prompt": "${prompt}", "n": 1, "strength": 0.3 } EOF ) ``` ```bash # Video generation with a reference image payload=$(cat <<EOF { "model": "doubao-seedance-1-0-pro-fast-251015", "content": [ {"type": "text", "text": "${prompt}"}, {"type": "image_url", "image_url": {"url": "${image_url}"}} ], "resolution": "720p", "ratio":"16:9", "duration": 5, "seed": 11, "camera_fixed": false, "watermark": true } EOF ) ``` ### Technical Analysis The script interpolates the user-controlled `prompt` and `image_url` values directly into JSON heredocs without applying JSON string encoding. Characters such as double quotes, backslashes, newlines, and control characters can terminate or alter the intended JSON string. For example, a prompt containing a value structurally similar to: ```text test", "n": 10, "extra": " ``` would modify the generated request body rather than remaining a single prompt string. Depending on the remote API's handling of duplicate or unexpected properties, this may cause request rejection or manipulation of accepted request parameters. This is request-body injection rather than shell-command injection. The input remains inside a shell variable and is passed to `curl` as a quoted argument, so the reviewed code does not establish arbitrary local command execution through this flaw. ### Attack Path 1. An attacker supplies a crafted prompt or image URL through an application or agent th ...[truncated 1009 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct every request body with a JSON-aware encoder such as `jq`, rather than textual interpolation: ```bash payload="$(jq -n \ --arg model "doubao-seedream-3-0-t2i-250415" \ --arg prompt "$prompt" \ '{model: $model, prompt: $prompt, n: 1}')" ``` For image-editing requests: ```bash payload="$(jq -n \ --arg model "doubao-seedream-4-0-250828" \ --arg image "$image_url" \ --arg prompt "$prompt" \ '{ model: $model, image: $image, prompt: $prompt, n: 1, strength: 0.3 }')" ``` Apply the same approach to both video payload variants. Additionally: 1. Validate `image_url` with a strict URL parser or allow only expected `https://` URLs. 2. Reject control characters where they are not operationally required. 3. Validate `sync_mode` against an explicit `sync|async` allowlist. 4. Enforce reasonable input-length limits. 5. Add tests containing quotes, backslashes, Unicode, and line breaks to verify that input remains a single JSON string. 6. Validate the generated payload with `jq -e .` before sending it. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:444
Finding
Troubleshooting Guidance Encourages Disclosure of the Complete API Key<![CDATA[ ## Vulnerability Details **File Location**: `README.md:444-451` **Vulnerability Type**: Sensitive credential exposure through diagnostic output **Risk Level**: Medium ### Vulnerable Code ```text 如遇到问题,请提供以下信息: 1. 系统环境:`uname -a` 2. Shell 版本:`bash --version` 3. 错误信息:完整错误输出 4. 环境变量:`env | grep ARK_API_KEY` ``` The relevant command is: ```bash env | grep ARK_API_KEY ``` ### Technical Analysis The documentation asks users reporting a problem to provide environment-variable output produced by `env | grep ARK_API_KEY`. This command prints the complete name and value of `ARK_API_KEY`. API keys are bearer credentials: possession is generally sufficient to authenticate API requests. Diagnostic information is commonly pasted into public issue trackers, chat systems, CI logs, or support tickets. Consequently, following the documented troubleshooting process can disclose the credential to unintended recipients. The script itself sends the key only to the declared Volcengine HTTPS endpoint. The vulnerability is specifically the unsafe support instruction, not evidence of intentional credential exfiltration. ### Attack Path 1. A user encounters an operational problem with the skill. 2. The user follows the README's troubleshooting instructions. 3. The user runs `env | grep ARK_API_KEY`. 4. The terminal prints the complete bearer credential. 5. The user includes that output in a public issue, support conversation, log archive, or screen recording. 6. An unauthorized party retrieves the key and uses it to call Volcengine APIs until the credential is revoked or expires. ### Impact Assessment An exposed party could obtain all API privileges assigned to the leaked `ARK_API_KEY`. Potential consequences include unauthorized generation requests, consumption of account quotas, financial charges, and access to other API operations allowed by the same credential. This does not grant local operating-system privileges. The scope is the remote Volcengine account a ...[truncated 47 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Remove all instructions that request the value of `ARK_API_KEY`. Replace the command with a presence-only test: ```bash if [ -n "${ARK_API_KEY:-}" ]; then echo "ARK_API_KEY is set" else echo "ARK_API_KEY is not set" fi ``` If identification is operationally necessary, display only a short non-sensitive fingerprint generated locally and explicitly warn users not to share the original value. Also: 1. Add a prominent warning that API keys must never be included in bug reports or logs. 2. Provide a diagnostic script that reports only whether required variables and tools are available. 3. Redact bearer tokens and signed media URLs from copied `curl` output. 4. Instruct users who have already shared a key to revoke and rotate it immediately. 5. Review public issue templates and support procedures for other secret-collection instructions. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
README.md:65
Finding
API Key Verification Commands Print the Secret in Plaintext<![CDATA[ ## Vulnerability Details **File Location**: `README.md:65-72` and `README.md:299-320`; equivalent guidance appears in `SKILL.md:251-269` **Vulnerability Type**: Plaintext exposure of a bearer credential in terminal output **Risk Level**: Low ### Vulnerable Code ```bash # 设置 API Key export ARK_API_KEY="your_api_key_here" # 或添加到 ~/.bashrc echo 'export ARK_API_KEY="your_api_key"' >> ~/.bashrc source ~/.bashrc # 验证 echo $ARK_API_KEY ``` The troubleshooting section repeats the same unsafe verification pattern: ```bash # 方式 1: 直接设置 export ARK_API_KEY="your_api_key_here" # 方式 2: 从配置文件 source source ~/.basic # 方式 3: 添加到 ~/.bashrc echo 'export ARK_API_KEY="your_api_key"' >> ~/.bashrc source ~/.bashrc # 验证 echo $ARK_API_KEY ``` ### Technical Analysis The verification command expands and prints the complete API key. Terminal output may be captured by shell-session recording, CI logs, remote support tools, screenshots, screen sharing, or copied command transcripts. Although printing a local environment variable requires the user to run the command, secure documentation should not normalize displaying secret material when a presence check is sufficient. The unquoted expansion also provides no security benefit and is unnecessary for verification. ### Attack Path 1. A user configures a real `ARK_API_KEY`. 2. The user follows the documented verification command. 3. `echo $ARK_API_KEY` writes the complete key to standard output. 4. Terminal output is recorded, shared, copied into diagnostics, or viewed by another person. 5. The observer retrieves and reuses the bearer credential against the Volcengine API. ### Impact Assessment A party who obtains the displayed value may perform remote API operations permitted by the key, consume quotas, and generate account charges. The impact is restricted to the authorization scope of the credential and does not directly provide local system privileges. The risk is lower than an automatic exfiltration flaw because ...[truncated 72 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Replace plaintext verification with a presence-only check: ```bash test -n "${ARK_API_KEY:-}" \ && echo "ARK_API_KEY is configured" \ || echo "ARK_API_KEY is not configured" ``` If masked confirmation is genuinely required, avoid exposing enough of the value to make recovery easier: ```bash if [ -n "${ARK_API_KEY:-}" ]; then printf 'ARK_API_KEY is configured; length=%s\n' "${#ARK_API_KEY}" fi ``` Further hardening should include: 1. Remove `echo $ARK_API_KEY` from both `README.md` and `SKILL.md`. 2. Warn users not to paste keys into terminals that are being recorded or shared. 3. Recommend a dedicated secret manager or protected environment configuration instead of plaintext shell startup files where supported. 4. Ensure startup files containing credentials have restrictive permissions. 5. Advise immediate rotation if a key has appeared in logs, screenshots, support messages, or public repositories. ]]>
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
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (43)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
HTTP客户端)
- jq(JSON处理,可选)
- ARK_API_KEY (从 https://console.volcengine.com/ark 获取)

### 安装步骤

```bash
# 1. 进入 skill 目录
cd ~/.openclaw/workspace/skills/doubao-skill-v2

# 2. 安装依赖
sudo apt-get install curl jq  # Ubuntu/Debian
# 或
brew install curl jq  # macOS

# 3. 设置环境变量
export ARK_API_KEY="your_api_key_here"

# 或添加到 ~/.bashrc
echo 'export ARK_API_KEY="your_api_key"' >> ~/.bashrc
source ~/.bashrc

# 4. 验证安装
cd scripts
./doubao.sh help
```

---

## 📚 使用方法

### 使用建议
1. 优先使用方法1
2. 视频生成任务优先使用同步方法,避免浪费token到监控步骤

### 方式 1(优先使用): Shell 脚本直接调用

```bash
cd ~/.openclaw/workspace/skills/doubao-skill-v2/scripts

# 生成图片
./doubao.sh img "一只可爱的小猫"

# 编辑图片(去除水印)
./doubao.sh edit "https://..." "remove watermark"

# 生成视频(异步)
./doubao.sh vid "一个人在跳舞" async '
Confidence
75% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
HTTP客户端)
- jq(JSON处理,可选)
- ARK_API_KEY (从 https://console.volcengine.com/ark 获取)

### 安装步骤

```bash
# 1. 进入 skill 目录
cd ~/.openclaw/workspace/skills/doubao-skill-v2

# 2. 安装依赖
sudo apt-get install curl jq  # Ubuntu/Debian
# 或
brew install curl jq  # macOS

# 3. 设置环境变量
export ARK_API_KEY="your_api_key_here"

# 或添加到 ~/.bashrc
echo 'export ARK_API_KEY="your_api_key"' >> ~/.bashrc
source ~/.bashrc

# 4. 验证安装
cd scripts
./doubao.sh help
```

---

## 📚 使用方法

### 使用建议
1. 优先使用方法1
2. 视频生成任务优先使用同步方法,避免浪费token到监控步骤

### 方式 1(优先使用): Shell 脚本直接调用

```bash
cd ~/.openclaw/workspace/skills/doubao-skill-v2/scripts

# 生成图片
./doubao.sh img "一只可爱的小猫"

# 编辑图片(去除水印)
./doubao.sh edit "https://..." "remove watermark"

# 生成视频(异步)
./doubao.sh vid "一个人在跳舞" async '
Confidence
75% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The skill explicitly implements watermark-removal assistance, which facilitates removal of provenance, branding, or copyright indicators from third-party images. In the context of a general image/video API wrapper, this adds a high-risk misuse capability unrelated to core functionality and can enable IP infringement or deceptive redistribution.

Ssd 2

High
Confidence
99% confidence
Finding
The default edit prompt automatically instructs the model to remove watermarks while preserving the original content, directly enabling attribution stripping with no extra user intent required. This lowers the barrier to misuse and creates a built-in circumvention behavior in the skill itself.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documentation advises users to persist the API key in ~/.bashrc, which stores a sensitive credential in a broadly readable and routinely sourced startup file without discussing exposure risks. This increases the chance of accidental disclosure through backups, screenshots, shell-history-adjacent troubleshooting, or access by other local processes/users.

Ssd 3

Medium
Confidence
98% confidence
Finding
Telling users to verify setup by running 'echo $ARK_API_KEY' encourages printing the full secret directly to the terminal, where it may be visible to shoulder-surfing, terminal logging, screen recording, or copied support transcripts. Exposing secrets in plaintext materially raises the risk of credential theft.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README demonstrates sending remote image URLs and prompts to an external API but does not clearly warn that user content is transmitted to a third-party service for processing. This omission can cause users to unknowingly upload sensitive media or confidential prompts, creating privacy and compliance risks.

Ssd 3

Medium
Confidence
99% confidence
Finding
The troubleshooting section asks users to share 'env | grep ARK_API_KEY', which can disclose the full API key in issue reports, chats, logs, or tickets. This is a direct secret-leak pattern and could allow unauthorized API use if the credential is exposed.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill documents and relies on shell execution but does not declare any explicit tool scope such as permissions or allowed-tools. This creates a security governance gap: an agent or platform may permit broader execution than intended, making review, sandboxing, and user consent harder for a skill that installs packages, edits shell startup files, and runs scripts.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
cd ~/.openclaw/workspace/skills/doubao-skill-v2

# 2. 安装依赖
sudo apt-get install curl jq  # Ubuntu/Debian
# 或
brew install curl jq  # macOS
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The documentation presents watermark/logo removal as a standard feature without any warning about copyright, ownership, authorization, or misuse. That normalizes a potentially abusive workflow and can facilitate unauthorized removal of attribution, licensing marks, or provenance indicators from third-party content.

Ssd 4

Medium
Confidence
99% confidence
Finding
The skill explicitly promotes watermark removal as a normal use case, which increases the likelihood of misuse for copyright evasion, attribution stripping, or fraudulent content reuse. In this context, the issue is more serious because the examples and default prompts directly steer users toward that behavior instead of presenting a general-purpose edit capability.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The manifest advertises text/image/video generation via the Doubao/Volcengine API but does not clearly warn that prompts, image URLs, and possibly related metadata will be transmitted to an external third-party service. This can lead users to submit sensitive data under the false assumption that processing is local, creating privacy, confidentiality, and compliance risks.

Static analysis

No suspicious patterns detected.