Back to skill

Security audit

WhatsApp Group Admin

Security checks for vulnerabilities and agentic risk

Overview

This skill provides WhatsApp group utilities, but it can read local WhatsApp session metadata to list groups and member counts without clearly warning the user.

Review before installing. Only use this skill with a WhatsApp account and OpenClaw state you are authorized to inspect, and expect the list/info commands to reveal private group identifiers, names, and inferred member counts from local session files.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/admin.js:8
Finding
Undisclosed WhatsApp Credential-Store Reconnaissance<![CDATA[ ## Vulnerability Details **File Location**: `scripts/admin.js:8-11, 39-56, 110-143` **Vulnerability Type**: Unauthorized access to sensitive local account metadata **Risk Level**: Medium ### Vulnerable Code ```js const CREDS_PATH = path.join( process.env.OPENCLAW_STATE_DIR || path.join(os.homedir(), '.openclaw'), 'credentials', 'whatsapp', 'default' ); ``` ```js const files = fs.readdirSync(CREDS_PATH); const memberFiles = files.filter(f => f.startsWith('sender-key-') && f.includes(groupId)); const members = new Set(); for (const file of memberFiles) { const match = file.match(/--(\\d+)_/); if (match) members.add(match[1]); } let name = null; try { const contactsPath = path.join(CREDS_PATH, 'contacts.json'); if (fs.existsSync(contactsPath)) { const contacts = JSON.parse(fs.readFileSync(contactsPath, 'utf8')); if (contacts[groupId]) { name = contacts[groupId].name || contacts[groupId].subject; } } } catch (e) { /* contacts not available */ } ``` ```js const files = fs.readdirSync(CREDS_PATH); const groupData = new Map(); for (const file of files) { if (file.startsWith('sender-key-') && file.includes('@g.us')) { const match = file.match(/sender-key-(.+@g\.us)--(\d+)/); if (match) { const groupId = match[1]; const memberId = match[2]; if (!groupData.has(groupId)) { groupData.set(groupId, { id: groupId, members: new Set() }); } groupData.get(groupId).members.add(memberId); } } } // Enrich with names try { const contactsPath = path.join(CREDS_PATH, 'contacts.json'); if (fs.existsSync(contactsPath)) { const contacts = JSON.parse(fs.readFileSync(contactsPath, 'utf8')); for (const [id, data] of groupData) { if (contacts[id]) { data.name = contacts[id].name || contacts[id].subject; } } } } catch (e) { /* contacts not available */ } ``` ### Technical Analysis The `info` and `list` commands directly enumerate OpenClaw's default W ...[truncated 2358 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace credential-directory scanning with an authenticated WhatsApp API that enforces the account's access controls. 2. Require explicit user confirmation before accessing locally stored WhatsApp state or displaying group metadata. 3. Clearly document all credential-store access in `SKILL.md`, including the exact data read and emitted. 4. Apply least privilege by avoiding participant-level identifier extraction when only aggregate statistics are required. 5. Redact group and participant identifiers by default, exposing full values only through an explicitly authorized option. 6. Validate and canonicalize `OPENCLAW_STATE_DIR`, then restrict access to an approved state root to prevent unintended directory selection. 7. Add an authorization boundary so that merely being able to invoke the skill does not automatically permit credential-state inspection. 8. Record security-relevant access without logging the sensitive metadata itself. 9. Return a clear error when authorization or consent is absent rather than silently inspecting the credential directory. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill exposes executable functionality via documented `exec` commands but does not declare any tool scope such as `permissions` or `allowed-tools`. That omission weakens least-privilege controls and can cause the skill to run with broader execution/environment access than reviewers or platforms expect.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The script derives a path to local WhatsApp state/credential material and uses it as an input source for its features. Accessing local session data is sensitive because it exposes private messaging metadata and group identifiers without an explicit consent flow, and the stated skill purpose does not clearly justify mining credential storage.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script reads sensitive WhatsApp state and contact metadata with no user-facing notice, warning, or consent mechanism. Even if intended for convenience, undisclosed access to messaging-related local data undermines user trust and can expose private relationship and group information.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The groupInfo path enumerates files in WhatsApp state storage and infers group membership from sender-key filenames rather than using a supported admin interface. This leaks private metadata about groups and participants from local session artifacts, creating a covert data-discovery capability that exceeds what a user would reasonably expect from a simple admin helper.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The list command bulk-enumerates all groups present in local WhatsApp session storage and derives membership statistics for each. Bulk discovery materially increases privacy risk because it creates an inventory of the user's groups and associated metadata at once, which is more dangerous than a narrowly targeted admin action.

Missing User Warnings

Low
Confidence
79% confidence
Finding
The skill documents commands that operate on WhatsApp group information and invite links, but it does not clearly warn that these commands may interact with live account data and a real WhatsApp session. In an administrative context, missing safety and data-sensitivity warnings increases the chance of unintended access, disclosure, or misuse against production groups.

Static analysis

No suspicious patterns detected.