Back to skill

Security audit

Openclaw Mention Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to support WhatsApp mentions as advertised, but it does so by patching OpenClaw core messaging files and storing identity mappings, which deserves careful review before installation.

Install only if you are comfortable with a skill that patches OpenClaw's installed JavaScript files, restarts the service, intercepts outgoing WhatsApp messages, and stores contact/group identity mappings locally. Review install.sh first, keep backups, restrict permissions on LID_CACHE.json, and avoid using add-member.js without --group unless you intentionally want every cached group updated.

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

T09 · Insecure Skill Coding Practices

Warning
Location
install.sh:221
Finding

Unrestricted WhatsApp Payload Forwarding Through Patched Reply Function

Content
View full analysis

Vulnerability Details

File Location: install.sh, lines 221-223
Vulnerability Type: Insufficient input and payload validation
Risk Level: Medium

Vulnerable Code

javascript
const reply = async (textOrPayload) => {
  const payload = typeof textOrPayload === 'string' ? { text: textOrPayload } : textOrPayload;
  await sendTrackedMessage(chatJid, payload);
};

This JavaScript is embedded in the installer and inserted into OpenClaw's global login-*.js distribution file.

Technical Analysis

The original text-only reply() interface is changed to accept either a string or an arbitrary object. When the argument is not a string, the object is passed unchanged to sendTrackedMessage().

The function does not:

  • Confirm that the supplied value is a non-null plain object.
  • Restrict the object to the intended text and mentions properties.
  • Validate mention identifiers.
  • Reject unsupported Baileys message fields.
  • Enforce payload size or content limits.

Consequently, this patch broadens a text-delivery interface into a generic Baileys message-payload forwarding interface. Its exploitability depends on whether an untrusted or compromised caller can control the argument passed to reply(). The reviewed package does not itself demonstrate such external control, but the missing validation creates an unsafe trust boundary in the globally patched OpenClaw function.

Attack Path

  1. The installer patches OpenClaw's global login-*.js file.
  2. A caller capable of controlling the argument to the patched reply() function supplies an object rather than a string.
  3. The function accepts the object without checking its properties.
  4. The complete object is forwarded to sendTrackedMessage(chatJid, payload).
  5. Baileys processes any supported message fields present in that object, potentially producing message behavior beyond the intended text-and-mentions feature.

This path requi ...[truncated 637 chars]

Remediation
View remediation

Remediation Suggestions

Replace arbitrary object forwarding with explicit payload construction and validation:

javascript
const reply = async (value) => {
  if (typeof value === "string") {
    await sendTrackedMessage(chatJid, { text: value });
    return;
  }

  if (
    value === null ||
    typeof value !== "object" ||
    Array.isArray(value) ||
    typeof value.text !== "string"
  ) {
    throw new TypeError("Invalid reply payload");
  }

  const mentions = Array.isArray(value.mentions)
    ? value.mentions.filter(
        (jid) => typeof jid === "string" && /^\d{10,20}@lid$/.test(jid)
      )
    : [];

  await sendTrackedMessage(chatJid, {
    text: value.text,
    mentions,
  });
};

Additional hardening should include:

  • Rejecting every property except text and mentions.
  • Applying reasonable limits to text length and mention count.
  • Verifying that mention LIDs belong to the current group before sending.
  • Keeping the mention-specific wrapper separate from the general message-sending API.
  • Adding tests that prove media, interactive-message, quoted-message, and protocol fields cannot pass through this interface.

T09 · Insecure Skill Coding Practices

Note
Location
install.sh:239
Finding

WhatsApp Identity Cache Created Without Restrictive File Permissions

Content
View full analysis

Vulnerability Details

File Locations: install.sh, lines 239-241; add-member.js, line 89
Vulnerability Type: Insecure permissions on locally stored identity information
Risk Level: Low

Vulnerable Code

Cache creation by the installer:

bash
if [ ! -f "$LID_CACHE" ]; then
  echo '{"_names":{},"_aliases":{}}' > "$LID_CACHE"
  chown openclaw:openclaw "$LID_CACHE"

Subsequent cache update by the utility:

javascript
fs.writeFileSync(CACHE_PATH, JSON.stringify(cache, null, 2));

The cache can contain display names, aliases, phone numbers, WhatsApp LIDs, group JIDs, and group membership mappings. The installer changes ownership but does not set an explicit restrictive mode. Initial permissions therefore depend on the installer's process umask. The update utility also does not verify or tighten the existing mode.

On a system using a common permissive umask such as 022, shell redirection can create the cache as mode 0644, allowing other local users to read it. This is a local information-disclosure issue rather than a remote compromise.

Technical Analysis

Ownership and permissions are separate controls. Calling chown openclaw:openclaw assigns the owner and group but does not remove read permissions granted to the group or other users.

Because the cache records stable WhatsApp identifiers and may include phone numbers and group relationships, it should be treated as sensitive personal metadata. Relying on an ambient umask makes protection dependent on deployment configuration and can expose this information on multi-user hosts.

Attack Path

  1. A privileged operator runs install.sh under a permissive umask.
  2. Shell redirection creates LID_CACHE.json with permissions that allow local non-owner reads.
  3. The installer changes ownership but does not run chmod.
  4. OpenClaw or add-member.js populates the cache with names, aliases, phone numbers, LIDs, and group mapp ...[truncated 813 chars]
Remediation
View remediation

Remediation Suggestions

Enforce restrictive permissions independently of the caller's umask:

bash
install -d -m 0700 -o openclaw -g openclaw "$WORKSPACE"

if [ ! -f "$LID_CACHE" ]; then
  install -m 0600 -o openclaw -g openclaw /dev/null "$LID_CACHE"
  printf '%s\n' '{"_names":{},"_aliases":{}}' > "$LID_CACHE"
fi

chown openclaw:openclaw "$LID_CACHE"
chmod 0600 "$LID_CACHE"

Harden add-member.js as well:

  • Open or create the cache with mode 0600.
  • Verify and correct permissions before and after each write.
  • Write to a mode-0600 temporary file in the same protected directory and atomically rename it.
  • Ensure the parent workspace directory is not accessible to unrelated local users.
  • Avoid silently replacing malformed cache content with an empty cache; report parsing errors so accidental data loss is visible.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The uninstall-related behavior described by analysis also modifies files under the OpenClaw installation path and restarts the system service. Even if intended as rollback logic, undeclared modification/restoration of application binaries is sensitive because mistakes or malicious tampering can leave the application in a broken or backdoored state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The uninstall-related behavior described by analysis also modifies files under the OpenClaw installation path and restarts the system service. Even if intended as rollback logic, undeclared modification/restoration of application binaries is sensitive because mistakes or malicious tampering can leave the application in a broken or backdoored state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The uninstall-related behavior described by analysis also modifies files under the OpenClaw installation path and restarts the system service. Even if intended as rollback logic, undeclared modification/restoration of application binaries is sensitive because mistakes or malicious tampering can leave the application in a broken or backdoored state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The README explicitly describes a patch that intercepts all outgoing messages and rewrites message text before sending, but it does not prominently warn users that assistant output will be altered in transit. This can create integrity and transparency issues: operators may believe the model sent one message while recipients receive modified content, which is especially risky in automation, auditing, or regulated communications contexts.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill metadata declares no explicit tool scope or permissions even though the described installation and operation imply filesystem access and environment interaction. In a skill ecosystem, missing permission declarations reduce transparency and prevent users or reviewers from understanding the true execution surface, which can enable over-privileged behavior to go unnoticed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation says the skill intercepts all outgoing WhatsApp messages and maintains a LID cache, but it does not prominently warn users about the privacy and behavioral implications of that interception and persistent contact/group mapping storage. In messaging contexts, hidden interception and identity caching are security-relevant because they affect user expectations and may expose sensitive metadata.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

A trigger that applies to all outgoing WhatsApp messages can cause the skill to run on ordinary conversation text, not just intentional mention-conversion cases. In context, that broad interception increases the chance of unexpected message rewriting, privacy issues, and accidental invocation across chats or groups.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The header comment and usage text describe this as a manual cache editor for adding a member, but the implementation also performs implicit bulk updates across all groups. This mismatch is dangerous because operators may run the script expecting a narrow change while actually mutating broad group membership data, increasing the chance of accidental privilege or data-scope expansion.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When a phone number is supplied without --group, the script silently adds the LID/phone mapping to every existing non-internal group entry in the cache. This creates an unexpected bulk membership modification path that can corrupt group-scoped data, broaden mention resolution beyond the intended group, and cause incorrect or unauthorized cross-group associations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The installer copies an additional add-member.js utility even though the declared skill purpose is only WhatsApp @mention conversion. Shipping and deploying an extra script outside the stated scope expands the attack surface and can introduce unauthorized functionality, especially because it is placed into the workspace where operators may later execute it implicitly or manually without separate review.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill converts @Name, @Phone, and @LID into clickable WhatsApp mentions. This guide explicitly states that @Name and @PhoneNumber should not be used because they 'won't be blue,' which directly contradicts the documented skill intent rather than merely omitting detail.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.