Back to skill

Security audit

Douyin Send DM

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built to send Douyin direct messages, but it needs review because it can send real messages from a logged-in browser without a required final confirmation and uses unsafe browser JavaScript handling for message text.

Install only if you are comfortable letting an agent control your logged-in Chrome session to send real Douyin DMs. Before use, require the agent to show the exact recipient and message for confirmation, and avoid sending externally supplied or complex text until the message insertion is changed to pass text as data rather than interpolating it into JavaScript.

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

Error
Location
SKILL.md:95
Finding

User-Controlled JavaScript Injection in Browser Evaluation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 95–96
Vulnerability Type: JavaScript injection through unsafe interpolation
Risk Level: High

Vulnerable Code

javascript
browser action=act profile=user targetId=<id>
  request={"kind":"evaluate","fn":"() => { const ed=[...document.querySelectorAll('[contenteditable=\"true\"]')].find(e=>{const r=e.getBoundingClientRect();return r.width>100 && r.height>20;}); if(!ed) return 'no-editor'; ed.focus(); const sel=window.getSelection(); const range=document.createRange(); range.selectNodeContents(ed); range.collapse(false); sel.removeAllRanges(); sel.addRange(range); document.execCommand('insertText',false,'<MESSAGE TEXT>'); return ed.innerText; }"}
text
Replace `<MESSAGE TEXT>` with the user's message. Escape single quotes (`'` → `\\'`).

Technical Analysis

The skill instructs the agent to interpolate user-controlled message content directly into JavaScript source executed by the browser's evaluate operation. Escaping only apostrophes is not sufficient to create a safe JavaScript string literal.

Backslashes, carriage returns, line feeds, Unicode line separators, and interactions between backslashes and escaped quotes can alter the generated source. In particular, attacker-controlled backslashes can interfere with the prescribed quote escaping, potentially terminate the intended string, and introduce arbitrary JavaScript statements.

The resulting code executes in the context of the user's authenticated Douyin page. This is more severe than ordinary message corruption because injected statements may access DOM-visible account or conversation data and perform actions with the active web session.

Attack Path

  1. An attacker supplies or influences the text that the user asks the agent to send.
  2. The agent follows the skill and replaces only apostrophes with the documented escape sequence.
  3. The agent inserts the resulting value in ...[truncated 1515 chars]
Remediation
View remediation

Remediation Suggestions

Do not concatenate user-controlled message content into executable JavaScript source.

  1. Pass the message as a separate structured argument to the browser evaluation function if the browser API supports evaluation arguments.
  2. If separate arguments are unavailable, serialize the message with a trusted JSON serializer rather than implementing character-by-character escaping. The resulting JSON string literal must be inserted without subsequent transformations.
  3. Prefer a browser typing or DOM API that accepts text as data independently from the evaluation source.
  4. Avoid innerHTML, template-generated scripts, eval, or similar dynamic-code mechanisms when inserting the message.
  5. Before sending, compare the editor's text against the original message exactly, allowing only explicitly documented editor artifacts such as a known zero-width character.
  6. Abort the operation if source construction, insertion, or equality verification fails.
  7. Add tests covering apostrophes, quotation marks, backslashes, multiline text, Unicode separators, escape-like sequences, and payload-shaped input.
  8. Treat externally sourced or indirectly supplied message text as untrusted even when the user requested the final send action.

A safe conceptual pattern is:

javascript
(message) => {
  const editor = findMessageEditor();
  editor.focus();
  document.execCommand("insertText", false, message);
}

Here, message must be supplied through the tool's structured argument mechanism rather than embedded in the function source.

Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Copy this `SKILL.md` (and parent directory) to that machine's skills root (e.g. `~/.openclaw/workspace/skills/douyin-send-dm/` or `~/.agents/skills/douyin-send-

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The metadata description says to use the skill whenever the user asks to send/DM/message someone on Douyin, including vague phrasings like 'tell @xyz hi' or 'ping that creator.' This creates an over-broad trigger surface for a real-world external action—sending a message from the user's logged-in account—which can cause unintended invocation from casual or ambiguous requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explains mechanics and verification but does not prominently warn that it will send a real direct message using the user's existing logged-in Douyin account. For external communications, lack of an upfront warning increases the risk that users do not realize the action has real account and privacy consequences.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
# Douyin: Send a DM via Chrome

Send a text DM to a Douyin user from the user's signed-in Chrome session, then verify the message actually delivered (Douyin will silently render bubbles even when DMs are banned — never claim success without checking).

## When to use

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger condition '抖音 / 私信 / 发私信 mentioned alongside a target user' is too ambiguous for a skill that performs an irreversible communication action. It could activate on discussion, translation, summarization, or planning requests rather than an actual instruction to send a DM, leading to unauthorized or surprising outbound messages.

Content

No source excerpt is available for this finding.