Back to skill

Security audit

Doubao Image Generator — AI 文生图工具 based on SeeDream 5.0

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Doubao image-generation skill, but users should review it because prompts and credentials are sent externally and some diagnostics/install guidance can expose sensitive details.

Install only if you are comfortable sending prompts and an ARK API bearer token to Volcengine/Doubao. Avoid putting secrets in project .env files or shell history, do not run diagnostics in shared logs until the API-key-prefix output is fixed, and use explicit confirmation before auto-triggered image generation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check-env.sh:51
Finding

Partial API Key Disclosure Through Environment-Check Output

Content
View full analysis

Vulnerability Details

File Location: scripts/check-env.sh, lines 51-59
Vulnerability Type: Sensitive credential exposure through logs
Risk Level: Medium

Vulnerable Code:

bash
# 只显示前 10 个字符用于验证
local display_value="${var_value:0:10}"
if [ ${#var_value} -gt 10 ]; then
    display_value="${display_value}..."
fi
log_info "✓ $var_name 已设置 ($display_value)"
return 0

The function is invoked with ARK_API_KEY at line 155:

bash
check_env_variable "ARK_API_KEY" || true

Technical Analysis

The environment-check function prints the first ten characters of every inspected secret. Because it is called for ARK_API_KEY, a portion of the API credential is disclosed to standard output.

Confirming that a credential exists does not require revealing any part of its value. Terminal output may be retained in CI/CD logs, Agent conversation transcripts, remote execution records, shell captures, or diagnostic reports. Consequently, users with access to those records can obtain partial credential material.

Although the exposed prefix is unlikely to be sufficient for authentication by itself, it can identify the credential format, correlate the same credential across systems, reduce the unknown search space, and amplify exposure when combined with another partial leak.

Attack Path

  1. A user or Agent runs scripts/check-env.sh as recommended by the project documentation.
  2. check_env_variable reads ARK_API_KEY through indirect environment-variable expansion.
  3. The function extracts and prints the first ten characters of the key.
  4. The output is retained in a terminal transcript, Agent conversation, CI log, support bundle, or other execution record.
  5. A party with access to that record obtains the credential prefix and may correlate it with other leaks or use it to identify the affected account or credential.

Exploitation requires access to the environment-check output; the ...[truncated 581 chars]

Remediation
View remediation

Remediation Suggestions

  • Never print any substring of an API key. Report only whether the variable is set.
  • Replace the vulnerable output with a constant status message:
    bash
    if [ -z "$var_value" ]; then
        log_error "Required environment variable is not set: $var_name"
        return 1
    fi
    
    log_info "Required environment variable is configured: $var_name"
    return 0
    
  • If operators require credential correlation, display a short one-way fingerprint calculated with a cryptographic hash instead of token characters. Clearly document that even fingerprints should not be emitted by default.
  • Ensure CI and Agent execution systems redact known API-key formats from logs.
  • Rotate the ARK API key if existing environment-check output has been published or shared with untrusted parties.

T05 · Unauthorized Access and Privilege Escalation

Note
Location
scripts/check-env.sh:207
Finding

Unnecessary Disclosure of Host and Execution-Context Information

Content
View full analysis

Vulnerability Details

File Location: scripts/check-env.sh, lines 207-214
Vulnerability Type: Excessive local environment reconnaissance and information disclosure
Risk Level: Low

Vulnerable Code:

bash
# 6. 系统信息
log_header "6. 系统信息"
log_info "操作系统:$(uname -s) $(uname -r)"
log_info "主机名:$(uname -n)"
log_info "架构:$(uname -m)"
log_info "当前用户:$(whoami)"
log_info "工作目录:$(pwd)"

Technical Analysis

The environment-check script collects and prints the operating-system release, hostname, architecture, current username, and working directory. Basic operating-system and architecture information may assist compatibility diagnostics, but the hostname, username, and working directory are not necessary to verify the dependencies required for image generation.

This behavior exceeds the minimum information needed for the declared functionality and exposes machine identity and execution-context details to any system that records command output. Internal hostnames may reveal naming conventions or infrastructure roles, usernames may identify accounts, and working directories may expose project names, account names, or filesystem layout.

The script does not transmit this information directly to an external server. Exposure occurs through stdout and any terminal, Agent, CI, support, or orchestration system that retains the output.

Attack Path

  1. A user or Agent runs the advertised environment-check script.
  2. The script executes uname, whoami, and pwd without requiring explicit diagnostic consent.
  3. The hostname, current account, and filesystem location are printed to standard output.
  4. An execution platform stores the output in logs, an Agent transcript, or a support record.
  5. A party with access to those records uses the information to map the host, identify likely accounts, infer internal naming conventions, or tailor subsequent attacks.

This issue does not itself provide code execut ...[truncated 725 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove collection and output of the hostname, current username, and working directory from the default environment check.
  • Retain only compatibility information that is demonstrably required, such as operating-system family and CPU architecture.
  • Place any extended diagnostics behind an explicit option such as --diagnostics, and explain exactly what information it will expose before collecting it.
  • Redact account names and sensitive path components if filesystem context must be reported.
  • Avoid automatically attaching environment-check output to public issues or external support requests.
  • Add tests that verify the default script output does not contain the values returned by hostname, whoami, or pwd.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (29)

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The README instructs users to store the API key in a project-root .env file. While common, this increases the chance of credential exposure through accidental commits, backup leakage, workspace sharing, or broader file access by other tools in the same environment.

Content

Scanner excerpt · README.md (reported line 317)May include surrounding context.

创建 .env 文件在项目根目录:

bash
# .env
ARK_API_KEY=your_api_key_here
DOUBAO_API_TIMEOUT=120
DOUBAO_RETRY_COUNT=5

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The README recommends sourcing .env directly into the shell and suggests direnv. If the file contents are modified maliciously, sourcing executes shell content in the current session rather than merely reading key-value pairs, which can lead to arbitrary command execution in addition to credential exposure.

Content

Scanner excerpt · README.md (reported line 329)May include surrounding context.

bash
# Bash
source .env

# 或使用 direnv
direnv allow

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

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · README.md (reported line 510)May include surrounding context.

che_file, 'w') as f: json.dump({"path": str(path)}, f)

text
       return path
text

## 🔧 故障排除

### 常见问题

#### 1. 缺少 ARK_API_KEY

**错误信息:**

ERROR: 缺少 ARK_API_KEY 环境变量

text

**解决方案:**
```bash
# 临时设置(当前终端会话)
export ARK_API_KEY="your_api_key"

# 永久设置(添加到 shell 配置文件)
echo 'export ARK_API_KEY="your_api_key"' >> ~/.bashrc
source ~/.bashrc

2. API 调用失败

错误信息:

text
API 错误:认证失败:API Key 无效或已过期

解决方案:

  1. 检查 API Key 是否正确复制
  2. 访问 火山引擎控制台 重新生成
  3. 确认账户余额充足

3. 图片下载失败

错误信息:

text
下载错误:图片下载失败:Connection timeout

解决方案:

bash
# 增加超时时间
python3 scripts/doubao-image-generate.py \
  --prompt "图片描述" \
  --timeout 1

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The stated purpose is image generation, but the skill also documents environment inspection, system information collection, network connectivity testing, and local file/permission checks. These extra behaviors expand the data-access surface beyond user expectations and could expose secrets or host metadata that are unrelated to the primary task.

Content

No source excerpt is available for this finding.

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

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

式

方式一:通过 Clawhub 安装(推荐)

bash
# 在 WorkBuddy 中执行
skill install doubao-image

方式二:手动安装

bash
# 1. 克隆或下载技能到本地
git clone https://github.com/your-username/doubao-image-skill.git ~/.workbuddy/skills/doubao-image

# 2. 设置执行权限
chmod +x ~/.workbuddy/skills/doubao-image/scripts/*.sh

# 3. 配置环境变量
echo 'export ARK_API_KEY="your_key"' >> ~/.bashrc
source ~/.bashrc

方式三:直接复制

将 doubao-image 文件夹复制到 ~/.workbuddy/skills/ 目录即可。

🚀 使用方法

基础用法

bash
# 使用默认参数生成图片
./scripts/doubao-image-generate.sh "一只在月光下的白色小猫"

# 指定分辨率(2K/1080P/720P)
./scripts/doubao-image-generate.sh "赛博朋克风格的城市夜景" "1080P"

# 关闭水印
./scripts/doubao-image-generate.sh "山水画" "2K" "false"

Python 脚本用法

bash
# 基础用法
python3 scripts/doubao

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 · OPTIMIZATION_REPORT.md (reported line 87)May include surrounding context.

WATERMARK="${3:-true}"

基础 API 调用

curl -s -X POST "$API_URL" -H "Authorization: Bearer $ARK_API_KEY" -d "$BODY"

text

**优化后:**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README describes using a remote ARK API for image generation but does not prominently warn that user prompts and API credentials will be sent to a third-party service. This creates a privacy and data-handling risk because users may provide sensitive prompts without understanding they leave the local environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states the skill auto-triggers on broad, everyday phrases such as '创建图片', '画一张', and '帮我画'. In an agent environment, overly generic triggers can cause unintended invocation and unexpected transmission of user prompts to an external service, especially when users are speaking conversationally rather than explicitly opting into this skill.

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 · README.md (reported line 541)May include surrounding context.

--timeout 120

检查网络连接

curl -I https://ark.cn-beijing.volces.com

text

#### 4. 请求频率超限

Ssd 2

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The troubleshooting guidance advises users to modify blocked prompts and use 'more indirect wording' after safety filtering. That is effectively guidance for bypassing platform content controls, which can facilitate prohibited or unsafe content generation and undermine downstream safety mechanisms.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill documentation describes capabilities that use environment variables, network access, and shell execution, but the manifest does not declare any explicit tool scope or permissions boundaries. In an agent ecosystem, missing scope declarations can cause overbroad execution authority, reducing transparency and allowing the skill to access sensitive capabilities without informed approval.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The auto-trigger description lacks boundaries, exclusions, or user-confirmation requirements, making activation criteria ambiguous. In agent settings, unclear triggering can lead to accidental execution of external requests and local actions based on loosely matched natural-language input.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad everyday language such as requests to 'draw' or 'generate an image,' which can cause unintended activation in unrelated conversations. Overbroad activation increases the chance of accidental network requests, secret use, or file writes without clear user intent.

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 · SKILL.md (reported line 245)May include surrounding context.

3. API 调用

bash
curl -X POST "https://ark.cn-beijing.volces.com/api/v3/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -d '{

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

curl -L "图片 URL" -o "output.png"

检查输出目录权限

chmod 755 generated-images/

text

### Q4: 如何批量生成?

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This file presents all instructions, examples, headings, and usage notes exclusively in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints the first 10 characters of ARK_API_KEY to the console as a verification aid. Even partial secret disclosure is risky because terminal logs, CI output, shell history capture tools, screenshots, and shared support sessions can expose enough information to aid credential identification or correlation, and secrets should not be echoed at all unless explicitly requested in a secure debug mode.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/doubao-image-generate.py (reported line 178)May include surrounding context.

python
try:
            if HAS_REQUESTS:
                response = requests.post(
                    API_URL,
                    headers=headers,
                    json=body,

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script performs an outbound POST request to an external API and includes both the user's prompt and a bearer token in the transaction. In the context of an agent skill, external transmission is expected for functionality, but it still constitutes a true security-relevant issue because sensitive prompt data and credentials leave the host and rely on a remote service's handling and security posture.

Content

Scanner excerpt · scripts/doubao-image-generate.sh (reported line 286)May include surrounding context.

sh
local temp_file
        temp_file=$(mktemp)
        
        http_code=$(curl -s -w "%{http_code}" -o "$temp_file" \
            -X POST "$API_URL" \
            -H "Content-Type: application/json" \
            -H "Authorization: Bearer $ARK_API_KEY" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends the user-supplied prompt to a third-party image generation API, but the execution flow does not present a clear just-in-time disclosure or consent checkpoint at the moment data leaves the local environment. Prompts can contain sensitive business, personal, or confidential content, so silent transmission creates a real privacy and data-handling risk even if this is the core feature of the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file presents its title and primary explanatory text in Chinese, and even links to Chinese-localized standards pages, which indicates a fixed language choice. There is no nearby note offering alternative language support or explaining that the skill is intentionally China-region-specific, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The detailed description explicitly lists '详细的中文文档' as a characteristic, which indicates a fixed language expectation. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly justified, and no such justification or alternative is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file uses Chinese as the sole language for the title and, throughout the document, all instructions and status text remain Chinese-only. Under the natural-language policy rule, forcing a specific language without user opt-in can be a locale-policy issue when no justification or alternative language option is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains user-facing operational instructions exclusively in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-only audience for a documented reason. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

L003 将技能表述为“豆包文生图 Skill”,而 L151 又描述为“基于豆包 SeeDream 5.0 模型的 AI 文生图工具”,与当前清单中多处测试项和总技能描述中的“支持 AI 绘图、插画创作等功能”相比,文档对技能边界的表述并不统一。L029-L033 和 L240 还宣称功能描述清晰、工作流完整、已准备发布,但该文件本身呈现出命名和能力范围不一致,属于文档意图与实际内容存在偏差。

Content

No source excerpt is available for this finding.