Back to skill

Security audit

短视频发布策略生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a video publishing helper, but it has review-worthy risks around external image upload, credential handling, persistent logs, and official-looking watermark-free image edits.

Install only after reviewing the image workflow carefully. Use it only with images you own or are allowed to edit, avoid official documents or third-party branded assets, do not remove watermarks or provenance marks, and do not run the cover script unless you trust the API endpoint and credential path. Prefer a fixed trusted HTTPS provider, a dedicated low-privilege API key, and a clean output directory; delete or disable api_response_content.log if sensitive material is processed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_cover_image.py:46
Finding

Caller-Controlled API Endpoint Can Receive Sensitive Images and Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_cover_image.py, lines 46–70 and 112
Vulnerability Type: Unrestricted external API destination and sensitive-data disclosure
Risk Level: High

python
client = OpenAI(
    api_key=get_config_value("qdd"),
    base_url=base_url
)

print(f"Encoding base image from {base_image_path}...")
base64_image = encode_image_to_base64(base_image_path)

final_prompt = prompt_template.format(text_to_add=text_to_add)
print("Using provided prompt...", final_prompt)

print("Sending request to the image generation API...")
try:
    response = client.chat.completions.create(
        model=model,
        messages=[
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": final_prompt},
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": f"data:image/png;base64,{base64_image}"
                        }
                    }
                ]
            }
        ],
python
parser.add_argument("--base-url", required=True, help="The API base URL.")

Technical Analysis

The script reads the complete user-selected image, Base64-encodes it, and transmits it together with the generated prompt to an OpenAI-compatible endpoint. Uploading an image is necessary for the declared AI image-editing operation. Base64 is normal transport encoding here and is not, by itself, evidence of covert exfiltration.

The security issue is that base_url is supplied directly by the caller without an HTTPS requirement, trusted-host allowlist, redirect policy, or user confirmation. The OpenAI client also uses the configured API key when contacting this destination. Consequently, a manipulated invocation can direct sensitive image content, prompts, and authentication material to an attacker-controlled se ...[truncated 1198 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove caller-controlled endpoint selection unless custom providers are an explicit functional requirement.
  • Pin the client to a documented, trusted HTTPS API origin.
  • If multiple providers must be supported, enforce an exact hostname allowlist and reject non-HTTPS URLs, embedded credentials, IP literals, unexpected ports, and untrusted redirects.
  • Use a separate credential for each approved provider and never send one provider's credential to another provider.
  • Display the selected destination and require explicit user approval before uploading an image.
  • Document that the full image and prompt leave the local system.
  • Apply request-size limits and validate that the selected input is a supported image before transmission.
  • Add automated tests proving that unapproved schemes, hosts, ports, and redirect targets are rejected.

T01 · Skill Instruction Hijacking

Error
Location
scripts/run.py:34
Finding

Untrusted User Content Is Embedded in Executable-Looking Tool Syntax

Content
View full analysis

Vulnerability Details

File Location: scripts/run.py, lines 34–49
Vulnerability Type: Tool-call injection and delegated prompt injection
Risk Level: High

python
# 将用户输入填充到模板中
final_prompt = prompt_template.replace('[请在此处粘贴客户背景信息,包括:IP定位、核心价值观、目标用户画像、已发布视频的平均表现等]', args.background)
final_prompt = final_prompt.replace('[请在此处粘贴本周的周计划或核心目标。这能帮助AI理解本条视频在整体策略中的位置和作用]', args.plan)
final_prompt = final_prompt.replace('[请在此处粘贴完整的视频文案,最好能标注出关键情绪点或转折点]', args.script)
final_prompt = final_prompt.replace('[请在此处填写这是第几条视频,并说明其在发布序列中的作用。例如:第一条,人设定位视频,用于账号冷启动;或:第三条,干货教学视频,用于建立专业信任]', args.position)

# 实际场景中,这里会调用 openclaw sessions_spawn
# 为简化演示,我们先将最终构建好的指令打印出来,以供模型在下一步中调用

# 将最终的prompt封装为OpenClaw工具能识别的JSON格式
output_for_openclaw = {
    "tool_code": f"sessions_spawn(task='{json.dumps(final_prompt)}', agentId='sub-agent-text-strategist')"
}

# 实际应用中会直接执行,这里我们打印出来给主模型看
print(json.dumps(output_for_openclaw, ensure_ascii=False, indent=2))

Technical Analysis

The four command-line fields are untrusted content. They are first inserted directly into a model prompt and then embedded inside a string that resembles executable OpenClaw tool syntax.

json.dumps(final_prompt) serializes the prompt as JSON, but the resulting JSON string is then placed inside a separate single-quoted task='...' context. JSON escaping does not escape apostrophes for that outer syntax. A user-controlled apostrophe can therefore terminate the apparent task argument if a downstream component evaluates or follows tool_code.

Independently of syntax breaking, attacker-controlled instructions in the background, plan, script, or position fields are delegated to the sub-agent without a trust boundary telling it to treat those values only as data. This allows conventional prompt injection against the strategy agent.

Attack Path

  1. An attacker supplies a crafted value through one of the four required arguments.
  2. The value c ...[truncated 1207 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not serialize tool calls as executable code strings.

  • Invoke sessions_spawn through a structured API in which task and agentId are separate typed fields.

  • If output must be serialized, emit ordinary data such as:

    json
    {
      "tool": "sessions_spawn",
      "arguments": {
        "task": "...",
        "agentId": "sub-agent-text-strategist"
      }
    }
    
  • Ensure the consumer parses this as data and never evaluates it as Python, JavaScript, shell code, or model-generated tool syntax.

  • Delimit user-controlled prompt fields clearly and add higher-priority instructions stating that content inside those fields is untrusted data, not instructions.

  • Apply schema validation and length limits to all four inputs.

  • Restrict the delegated agent to the minimum tools necessary for text strategy generation; ideally, it should have no filesystem, shell, network, or unrelated agent-spawning capabilities.

  • Add tests using apostrophes, escaped strings, multiline instructions, and forged tool expressions to confirm they cannot alter the structured call.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_cover_image.py:82
Finding

Complete API Responses Are Persisted to a Predictable Log File

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_cover_image.py, lines 82–85
Vulnerability Type: Insecure logging of potentially sensitive API content
Risk Level: Medium

python
print("API response received.")
# 保存完整响应内容到日志文件(便于调试)
with open("api_response_content.log", "w", encoding="utf-8") as f:
    f.write(str(response))

Technical Analysis

Every successful API response is converted to a string and written to api_response_content.log in the process's current working directory. Logging occurs unconditionally and has no redaction, retention control, user opt-in, secure temporary-file handling, or explicit restrictive permission configuration.

An API response may contain generated image data, prompts or echoed content, request identifiers, provider metadata, moderation details, or diagnostic information. Because the filename is predictable, other local processes or users with access to the working directory can locate it easily. The file can also be unintentionally included in backups, support bundles, or project artifacts.

Attack Path

  1. A user processes private or commercially sensitive content.
  2. The external provider returns an API response containing generated content and metadata.
  3. The script writes the complete response to a predictable file in the current directory.
  4. The file remains after the operation finishes.
  5. Another local user, process, backup job, or artifact collector reads or exports the retained response.

Impact Assessment

This issue can disclose API response content to principals that can read the working directory. The exact exposure depends on operating-system permissions and the provider's response structure. It does not independently grant code execution or elevated system privileges, but it creates unnecessary persistent storage of potentially sensitive data beyond the cover-generation task's requirements.

Remediation
View remediation

Remediation Suggestions

  • Remove complete-response logging from normal operation.
  • Make diagnostic logging explicitly opt-in through a debug flag that is disabled by default.
  • Log only minimal metadata required for troubleshooting, such as a request identifier and status, rather than response bodies or image data.
  • Redact prompts, URLs containing embedded image data, credentials, user content, and provider-specific sensitive fields.
  • If a diagnostic file is unavoidable, create it in a secure application-specific directory with owner-only permissions and a randomized filename.
  • Implement automatic deletion and a documented retention limit.
  • Prevent debug logs from being committed, packaged, backed up, or returned as Skill output.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_cover_image.py:45
Finding

Undefined Credential Accessor Makes the Cover-Generation Workflow Fail

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_cover_image.py, lines 45–49
Vulnerability Type: Undefined credential configuration function and insecure configuration design
Risk Level: Medium

python
print("Initializing OpenAI client...")
client = OpenAI(
    api_key=get_config_value("qdd"),
    base_url=base_url
)

Technical Analysis

get_config_value is neither defined nor imported anywhere in the reviewed project. Python evaluates the api_key argument while constructing the client, so execution raises NameError before the image-generation request can be made. The configuration identifier "qdd" is also opaque and undocumented.

This is primarily an availability and secure-configuration defect rather than evidence of credential theft. However, a broken and undocumented credential path may encourage operators to patch the script with hardcoded secrets or expose keys through command-line arguments.

Attack Path

  1. A user invokes generate_cover_image.py with all documented runtime inputs.
  2. Execution reaches OpenAI client initialization.
  3. Python attempts to evaluate get_config_value("qdd").
  4. Because the function is undefined, the process terminates with NameError.
  5. The declared cover-generation operation cannot complete. Operators may then apply unsafe ad hoc credential workarounds if no supported configuration method is provided.

Impact Assessment

The immediate impact is denial of the advertised image-generation functionality for all normal invocations. This defect does not itself provide an attacker with additional privileges or reveal a credential. Its security relevance is the unreliable and undocumented secret-management design, which increases the likelihood of insecure deployment modifications.

Remediation
View remediation

Remediation Suggestions

  • Replace the undefined accessor with a documented secret source, such as a standard environment variable or platform-managed secret store.
  • For example, read OPENAI_API_KEY from the environment and terminate with a concise configuration error if it is absent.
  • Never print the credential or include it in exception details, logs, generated tool output, or command-line arguments.
  • Use clear provider-specific secret names rather than the opaque identifier "qdd".
  • Keep provider credentials separate when multiple approved endpoints are supported.
  • Add a startup configuration check and unit tests covering missing, empty, and malformed credential settings.
  • Update SKILL.md so its execution example matches all actual required arguments and the supported credential mechanism.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This second mismatch finding is also valid: the file instructs the agent to gather extra inputs and construct downstream prompts, but it does not actually implement the promised outputs within the skill itself. Such discrepancies can conceal actual behavior, including delegation patterns and unannounced processing steps, which increases operational and security ambiguity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This second mismatch finding is also valid: the file instructs the agent to gather extra inputs and construct downstream prompts, but it does not actually implement the promised outputs within the skill itself. Such discrepancies can conceal actual behavior, including delegation patterns and unannounced processing steps, which increases operational and security ambiguity.

Content

No source excerpt is available for this finding.

Ssd 4

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The multi-step workflow—remove old text, add replacement text matching the original style, and make the result look official—amounts to a recipe for covert media alteration. In a general video-publishing context, this is especially risky because it can be applied beyond thumbnails to falsify notices, screenshots, posters, or branded materials.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Telling the model to produce an 'official, seamless modification' directly promotes deceptive presentation of altered media. This is dangerous because it helps conceal that an image was edited, enabling impersonation, misinformation, or forged promotional assets that appear authentic.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill describes file reads and a local Python/PowerShell workflow, but it does not declare any explicit tool scope or permissions. This creates an authorization and review gap: an agent may attempt file access beyond what a user expects, and operators cannot easily constrain or audit the capability surface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description and operational instructions are written entirely in Chinese and present the skill as producing publishing assets in that locale, but the file does not state that the skill is China-specific or offer any language/locale opt-in. This can constitute a language/locale policy violation because the skill appears to force a specific language without explicit user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs execution of a local PowerShell and Python workflow that reads prompt files and modifies image files, but it provides no user-facing warning or safety boundaries. This is dangerous because local script execution and file modification can overwrite data, touch unintended paths, or expose the environment to unsafe command invocation without the user's informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Natural-language policy review applies to all file types. The instructions, fields, and output requirements are all presented in Chinese with no indication that the user may choose another language, which can amount to forcing a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

Natural-language comments and the default prompt are written in Chinese, and the default operational prompt at runtime is also Chinese-only. This creates a language/locale constraint without user opt-in or documented justification, which matches the policy category for forced language behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends the base image and user-supplied text to an external API endpoint specified by --base-url, but provides no disclosure, trust boundary validation, or consent mechanism. In this skill context, uploaded images may contain private or proprietary marketing assets, so silent transmission increases confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Persisting the full API response to disk without warning can expose generated content, prompts, and metadata to other local users, backup systems, or log collectors. This compounds the privacy risk because even if the remote call is expected, the script also creates an undeclared local copy of potentially sensitive content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The default --prompt value is a Chinese-only instruction string, which steers the skill toward a specific language by default. There is no accompanying option, prompt, or documentation that asks the user to choose their preferred language or explains why Chinese is required.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This plain-text skill prompt describes a generic task to edit text on a provided image without defining specific activation constraints, trigger phrases, or exclusions. Because it is framed broadly as a general image text-replacement capability, it risks matching common editing requests beyond a narrowly scoped use case.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The prompt explicitly instructs removal of original text and creation of a watermark-free final image without any safeguards about authorization, provenance, or deceptive editing. This can facilitate misleading image alteration, including stripping attribution/watermarks or altering contextual text in ways that make manipulated media appear authentic.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The prompt explicitly instructs the model to make the edited image look like an 'official, seamless modification,' which encourages deceptive alteration rather than ordinary cover-image generation. In the context of a video publishing skill, this exceeds benign styling assistance and can be repurposed to forge or misrepresent branded, documentary, or authoritative imagery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instruction to output the image 'without any watermarks' removes provenance or attribution cues that could help viewers recognize edited or generated media. Combined with the prompt's emphasis on seamless official-looking edits, this increases the likelihood of deceptive redistribution and misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The prompt explicitly instructs the model to produce a 'watermark-free image,' which encourages removal of ownership or provenance markings from source content. In a skill focused on replicating and editing template images for publication, this materially increases the risk of facilitating copyright infringement, impersonation of official assets, or laundering reused media as original content.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This is a plain text file, so vague-trigger review applies. The prompt defines a role and asks the user to input information, but it does not specify when this skill should or should not be used, nor does it include any negative examples or narrow trigger phrases, which could allow overly broad use for general content-strategy requests.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script writes the full model response to a local log file, which can include generated image data, prompt text, and other potentially sensitive content. Because this happens unconditionally and without user consent or redaction, it creates an avoidable data exposure risk on shared systems or in CI/workspaces where logs may be collected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The script writes generated image data to the path provided by --output. While file output is expected for an image-generation tool, the requirement here is user disclosure, and the help text does not explicitly note that the target file may be created or overwritten as part of execution.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The CLI description says 'Generate a cover image via AI,' which suggests straightforward image generation or composition. However, the default prompt explicitly instructs the model to remove all existing text from the source image and return a final edited image, which is materially different from simply adding supplied cover copy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The docstring, CLI description, and all argument help text are written only in Chinese, which imposes a specific language on users with no opt-in or alternative locale. Under the policy, language constraints should either offer a user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.