Back to skill

Security audit

douyin-spark

Security checks for vulnerabilities and agentic risk

Overview

This skill is openly meant to automate Douyin private messages, but it gives an agent broad messaging authority without clear confirmation, preview, or scheduling safeguards.

Only install this if you are comfortable letting an agent use your logged-in Douyin session to message contacts. Before use, require a preview of recipients and exact message text, avoid unattended cron/HEARTBEAT runs, and keep the contact list limited to people who should receive these messages.

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

Note
Location
douyin-spark.js:55
Finding

Unsafe Shell Command Construction in Browser Command Helper

Content
View full analysis

Vulnerability Details

File Location: douyin-spark.js, lines 55-63
Vulnerability Type: OS command injection
Risk Level: Low

Vulnerable Code

js
function runBrowserCommand(args) {
  try {
    const cmd = `openclaw browser ${args}`;
    execSync(cmd, { stdio: 'pipe' });
    return true;
  } catch (error) {
    console.error('浏览器命令执行失败:', error.message);
    return false;
  }
}

Technical Analysis

The runBrowserCommand function concatenates its args parameter directly into a command string and passes the resulting value to child_process.execSync. By default, execSync executes command strings through a system shell.

If an attacker can influence args, shell metacharacters such as semicolons, command substitutions, pipes, or redirection operators can cause the shell to execute additional commands. For example, an argument containing a legitimate browser operation followed by a shell command could escape the intended openclaw browser invocation.

The audited version does not call or export runBrowserCommand, so no currently reachable exploitation path from the command-line arguments was identified. The vulnerable helper is therefore dormant in the present implementation. It would become exploitable if later connected to CLI parameters, contact data, webpage content, agent-generated values, or other untrusted input without strict validation.

Attack Path

A complete exploitation path would require the dormant helper to become reachable:

  1. An application change or integration passes attacker-controlled data to runBrowserCommand(args).
  2. The attacker includes shell metacharacters and an additional operating-system command in args.
  3. The function constructs a single command string:
    text
    openclaw browser <attacker-controlled content>
    
  4. execSync invokes the system shell to interpret that string.
  5. The shell executes both the expe ...[truncated 767 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove runBrowserCommand if it is not required.
  2. If command execution is required, avoid invoking a shell. Use execFileSync or spawnSync with an argument array:
    js
    const { execFileSync } = require('child_process');
    
    function runBrowserCommand(args) {
      if (!Array.isArray(args)) {
        throw new TypeError('Browser arguments must be an array');
      }
    
      execFileSync('openclaw', ['browser', ...args], {
        stdio: 'pipe',
        shell: false
      });
    
      return true;
    }
    
  3. Define a strict allowlist of supported browser actions and reject unknown flags, control characters, and unexpected value formats.
  4. Do not pass contact names, webpage text, agent-generated strings, or raw CLI parameters into process-execution functions.
  5. Prefer a direct OpenClaw API or structured browser-tool interface over spawning a command-line process.
  6. Add tests containing shell metacharacters to verify that user-controlled values are treated exclusively as literal arguments.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description emphasizes convenience features but does not clearly warn that it will automatically send bulk private messages from the user's account to multiple contacts. In this context, the capability is materially risky because it can spam contacts, create impersonation or social-engineering issues, and expose the user to account restrictions or reputational harm if triggered unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README suggests broad natural-language trigger phrases such as '帮我续火花' and '给火花联系人发消息' for an action that sends private messages. If the assistant maps these phrases too loosely, ordinary conversation could trigger unintended outbound messaging, causing unauthorized actions and privacy or reputation harm. In this context, the skill performs real account actions, which makes ambiguous invocation more dangerous than a harmless informational skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation recommends automated private messaging and daily scheduled execution without clearly warning about consequences such as spam-like behavior, unintended messages, account restrictions, or contacting people without fresh user review. Because this skill automates social interactions on Douyin, lack of disclosure increases the risk that users enable recurring actions without understanding behavioral, privacy, and platform-policy implications.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The invocation examples are short, common-language phrases such as '帮我续火花' and '给火花联系人发消息' that could be matched unintentionally in ordinary conversation. Because this skill triggers automated browser actions and bulk private messaging, accidental invocation could cause unsolicited messages to be sent to multiple contacts without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file, including headings and the default message template, is written exclusively in Chinese and does not indicate that language selection is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module comment describes an automated workflow that opens Douyin chat, clicks contacts, types messages, and reports results. In reality, sendSparkMessage only reads a local contacts file and prints step-by-step browser commands for a human or external AI assistant to execute; it never navigates, clicks, types, or sends messages itself.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The doc comment names this an automated send flow and lists operational browser steps as if the function carries them out. However, lines 97-125 only print a guide and contact list; no browser command is invoked and no message is actually sent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function presents a workflow for sending messages from the user's Douyin account through an AI/browser agent without an explicit warning, confirmation step, or consent boundary. In agent contexts, even instruction-only content can be dangerous because it encourages account actions on behalf of the user and normalizes automated outbound messaging, increasing the risk of unauthorized messages, spam, or policy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly directs the agent to send messages to all listed contacts every day, which is an action affecting third parties on the user's behalf. Because it lacks any requirement for explicit per-run confirmation, consent boundaries, or safeguards against automated outreach, it creates a meaningful risk of unauthorized or spam-like messaging and privacy harm to contacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The product description promotes automated bulk messaging and '代聊' behavior while only mentioning refund and generic usage notes, without meaningful warnings about account suspension, privacy exposure, consent, or abuse risks. In this context, the omission is dangerous because the skill is explicitly designed to automate direct-message activity on Douyin, increasing the likelihood of spammy behavior, unauthorized contact, and collection or misuse of contact/message data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The advertised trigger phrases are short, natural-language commands such as '帮我续火花' and '给火花联系人发消息', which are plausible everyday utterances and could activate the skill unintentionally in a shared agent environment. Because the skill performs automated messaging actions, accidental invocation could send bulk messages to contacts without deliberate user intent, causing privacy, reputation, or platform-policy harm.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented activation phrases are broad natural-language commands like '帮我续火花' and '查看火花联系人列表' without any indication of confirmation, explicit skill scoping, or user-consent boundaries. In an agent environment, this increases the chance of accidental or context-induced invocation of automated messaging behavior, which can trigger unintended actions on a logged-in Douyin account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installation guide promotes automated message sending to maintain '火花' status but does not clearly warn users about platform policy violations, rate limits, account restrictions, or other consequences of automating social interactions. Because the skill operates against a logged-in browser session, users may expose their account to suspension or abuse-detection actions without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

README 标题、说明和对话触发示例全部为中文,且未说明是否仅支持中文触发,或是否允许用户使用其他语言。这可能构成默认强制特定语言/locale 的自然语言策略问题,尤其是在面向通用用户的技能描述中。

Content

No source excerpt is available for this finding.