Back to skill

Security audit

万相 2.6 生成微信公众号封面图

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to generate images as advertised, but it handles API keys and shared environment files more broadly than needed.

Review this before installing if you keep other secrets in ~/.openclaw/.env or ~/.workbuddy/.env. Prefer passing only the DashScope API key through the environment or --api-key, avoid running the setup helpers while screen sharing, and do not rely on the package to keep repository-local .env files out of version control.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
wan26_generator.py:376
Finding

Overbroad Loading of Shared Credential Files

Content
View full analysis
None: """Load keys from .env into the environment without overwriting existing variables.""" if not os.path.exists(path): return with open(path, "r", encoding="utf-8") as f: for raw in f: line = raw.strip() if not line or line.startswith("#"): continue if "=" not in line: continue if line.startswith("export "): line = line[7:].strip() key, value = line.split("=", 1) key = key.strip() value = value.strip() if not key or " " in key: continue if key in os.environ: continue if (value.startswith('"') and value.endswith('"')) or ( value.startswith("'") and value.endswith("'") ): value = value[1:-1] os.environ[key] = value def load_local_env() -> None: """Load .env files from several OpenClaw-compatible locations.""" candidates = [] custom = os.getenv("OPENCLAW_ENV_FILE") if custom: candidates.append(custom) skill_dir = os.path.dirname(os.path.abspath(__file__)) candidates.append(os.path.join(skill_dir, ".env")) home = os.path.expanduser("~") candidates.append(os.path.join(home, ".openclaw", ".env")) candidates.append(os.path.join(home, ".workbuddy", ".env")) seen = set() for env_path in candidates: if not env_path or env_path in seen: continue seen.add(env_path) _apply_env_file(env_path) ``` The behavior is also explicitly documented in `SKILL.md:71-82`. ### Technical Analysis The Skill requires only a DashScope credential to perform its declared image-generation ...[truncated 1620 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
setup.sh:37
Finding

API Keys Are Entered with Terminal Echo Enabled

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
config.py:53
Finding

Repository-Local Secret Storage Is Not Protected by the Claimed Git Ignore Rule

Content
View full analysis
"$ENV_FILE" << EOF # wan2.6 image generation Skill - local secret # Generated by setup.sh and claimed to be listed in .gitignore DASHSCOPE_API_KEY=$API_KEY EOF chmod 600 "$ENV_FILE" ``` The audited project structure contains no `.gitignore`, despite documentation and comments asserting that `.env` is already ignored. ### Technical Analysis Both configuration tools write a plaintext API key to `.env` inside the project directory. File mode `0600` restricts local operating-system access but does not prevent Git from staging, committing, or publishing the file. Users are repeatedly told that `.env` is listed in `.gitignore`. Because no `.gitignore` was present in the audited project, this assurance is inaccurate and may cause users to rely on protection that does not exist. ### Attack Path 1. A user runs `setup.sh` or `config.py`. 2. The tool writes the API key to `/.env`. 3. The user trusts the statements that `.env` is already ignored. 4. The user runs a broad staging command or packages the directory. 5. The `.env` file is committed, uploaded, archived, or otherwise distributed. 6. Anyone with access to the resulting repository or archive obtains the API key. ### Impact Assessment Disclosure grants possession of the complete DashScope API key stored in the f ...[truncated 398 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
wan26_generator.py:494
Finding

Remote Image URLs Are Downloaded Without Destination or Size Validation

Content
View full analysis
1 else f"cover.{ext}" fpath = os.path.join(output_dir, fname) try: resp = _req.get(img["url"], timeout=60) resp.raise_for_status() with open(fpath, "wb") as fp: fp.write(resp.content) img["local_path"] = fpath saved.append(fpath) except Exception as dl_err: if not args.json_only: print(f"Download failed: {dl_err}", file=sys.stderr) ``` ### Technical Analysis The Skill treats every image URL returned by the remote API as trusted. Requests follows redirects by default, while the code does not validate: - The URL scheme. - The initial or final hostname. - Whether DNS resolution points to loopback, private, or link-local addresses. - The response content type. - The maximum response size. - Whether the downloaded bytes are a valid image. The response is fully buffered in memory through `resp.content` and then written to disk with a `.png` extension regardless of its actual type. A local user cannot directly provide this URL through the documented CLI, so exploitation requires a compromised or malicious upstream response, a service-side trust failure, or equivalent interference with the API result. This constraint lowers the risk level. ### Attack Path 1. A compromised or malicious upstream response supplies an attacker-selected image URL. 2. The Skill passes that URL directly to `requests.get()`. 3. Requests connects to the specified destination and follows redirects without destination validation. 4. The endpoint returns an oversized or non-image response. 5. The process buffers the response and writes it to disk as a PNG file. 6. This can cause un ...[truncated 645 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill presented as an image generator should not unexpectedly collect and persist API keys, create .env files, or modify file permissions unless those actions are clearly declared and tightly constrained. Persisting credentials locally and changing permissions can expose secrets to other local processes or users, especially when shared environment files such as ~/.openclaw/.env or ~/.workbuddy/.env are involved.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A skill presented as an image generator should not unexpectedly collect and persist API keys, create .env files, or modify file permissions unless those actions are clearly declared and tightly constrained. Persisting credentials locally and changing permissions can expose secrets to other local processes or users, especially when shared environment files such as ~/.openclaw/.env or ~/.workbuddy/.env are involved.

Content

No source excerpt is available for this finding.

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 · config.py (reported line 10)May include surrounding context.

python
import os
import sys

CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), '.env')


def check_current_config():

Credential Access

High
Category
Privilege Escalation
Confidence
79% confidence
Finding

This code writes the API key in plaintext to a local .env file. Although it attempts to set permissions to 0600 and warns against committing the file, plaintext secret storage can still expose credentials through local compromise, backups, editor history, syncing tools, or platforms where chmod is ineffective or fails.

Content

Scanner excerpt · config.py (reported line 53)May include surrounding context.

python
if confirm != 'y':
            return False
    
    # 创建或更新 .env 文件
    with open(CONFIG_FILE, 'w', encoding='utf-8') as f:
        f.write("# wan2.6 图片生成技能 - API Key 配置\n")
        f.write("# 此文件包含敏感的 API Key,请勿上传到版本控制系统\n")

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 · setup.sh (reported line 8)May include surrounding context.

sh
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/.env"

echo "=============================================="
echo "wan2.6 图片生成技能 - 配置向导"

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 · wan26_generator.py (reported line 409)May include surrounding context.

python
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/.env"

echo "=============================================="
echo "wan2.6 图片生成技能 - 配置向导"

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 · wan26_generator.py (reported line 411)May include surrounding context.

python
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/.env"

echo "=============================================="
echo "wan2.6 图片生成技能 - 配置向导"

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 · wan26_generator.py (reported line 412)May include surrounding context.

python
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/.env"

echo "=============================================="
echo "wan2.6 图片生成技能 - 配置向导"

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 · setup.sh (reported line 23)May include surrounding context.

sh
fi

if [ -f "$ENV_FILE" ]; then
    echo "✅ 本地 .env 存在:$ENV_FILE"
else
    echo "❌ 本地 .env 不存在"
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 · setup.sh (reported line 25)May include surrounding context.

sh
fi

if [ -f "$ENV_FILE" ]; then
    echo "✅ 本地 .env 存在:$ENV_FILE"
else
    echo "❌ 本地 .env 不存在"
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 · wan26_generator.py (reported line 376)May include surrounding context.

python
fi

if [ -f "$ENV_FILE" ]; then
    echo "✅ 本地 .env 存在:$ENV_FILE"
else
    echo "❌ 本地 .env 不存在"
fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises capabilities that include environment access, local file read/write, network access, and shell execution, but the manifest does not declare any explicit tool scope or permission boundaries. This creates unnecessary trust ambiguity for users and orchestrators, making it easier for a seemingly simple image-generation skill to perform broader actions such as reading local secrets or modifying files without clear disclosure.

Content

No source excerpt is available for this finding.

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 · setup.sh (reported line 59)May include surrounding context.

sh
DASHSCOPE_API_KEY=$API_KEY
EOF

chmod 600 "$ENV_FILE"

echo ""
echo "✅ 已保存到:$ENV_FILE"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module description and all user-facing CLI/help text are written only in Chinese, which imposes a specific language on users without any opt-in or alternative locale path. The policy explicitly flags language or locale constraints when the skill does not offer a language choice or document a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The user-facing output hard-codes the region as "beijing" and the API endpoint to an Alibaba Cloud China endpoint, with no indication that the locale/region is configurable or that the tool is intentionally region-specific. Under the policy, forcing a locale or regional setting without opt-in or clear justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

dashscope>=1.25.8 is only lower-bounded, not fully pinned, so future installs may pull newer versions with unreviewed changes or security regressions. This creates a supply-chain and reproducibility risk, especially for a skill depending on an external cloud SDK for model access.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
dashscope>=1.25.8
requests

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency requests is unpinned, so installations may resolve to different versions over time, reducing build reproducibility and potentially introducing a vulnerable or incompatible release. In a skill that likely performs network/API calls for image generation, this increases supply-chain uncertainty even if it is not an immediately exploitable code flaw by itself.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
dashscope>=1.25.8
requests

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

requests has multiple known advisories, and because no version is pinned, there is no way to verify whether deployment will select a fixed or affected release. Given this skill's apparent reliance on outbound HTTP interactions, an affected requests version could expose credentials, weaken transport assumptions, or otherwise increase attack surface depending on usage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description limits the skill's purpose to generating 微信公众号封面图 and 技术架构设计图. However, the implementation adds a separate generate_article_images capability for multi-image article illustrations, which broadens the skill beyond the stated two use cases.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a text-to-image skill for generating specific kinds of images, which naturally implies remote API usage but does not mention persistent local file writing. The code goes further by creating directories under ~/WorkBuddy/..., downloading image URLs, and saving files locally as a side effect.

Content

No source excerpt is available for this finding.