Back to skill

Security audit

WhatsApp Business API

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent WhatsApp Business API guide, but it gives agents broad authority over messaging, customer data, account security, and local memory without enough safeguards.

Review before installing if the agent will operate on a real WhatsApp Business account. Use explicit approval for sending messages, deleting templates or media, and changing two-step verification; avoid storing customer or account details in plaintext memory unless you intentionally opt in and can control access to that file.

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
webhooks.md:57
Finding

Webhook Signature Verification Uses Reserialized JSON and Unsafe Buffer Comparison

Content
View full analysis
Remediation
View remediation
` format before comparison. 4. Reject absent, malformed, or incorrectly sized signatures with an HTTP 401 or 403 response. 5. Convert the hexadecimal digest portions to fixed-length byte buffers and confirm equal lengths before calling `timingSafeEqual`. 6. Wrap verification in controlled error handling that always fails closed. 7. Apply request-size limits and endpoint rate limiting. Example hardened implementation: ```javascript const crypto = require('crypto'); function verifySignature(rawBody, signatureHeader) { if ( !Buffer.isBuffer(rawBody) || typeof signatureHeader !== 'string' || !/^sha256=[a-f0-9]{64}$/i.test(signatureHeader) ) { return false; } const suppliedDigest = Buffer.from( signatureHeader.slice('sha256='.length), 'hex' ); const expectedDigest = crypto .createHmac('sha256', process.env.APP_SECRET) .update(rawBody) .digest(); return suppliedDigest.length === expectedDigest.length && crypto.timingSafeEqual(suppliedDigest, expectedDigest); } ``` Configure the web framework to expose `rawBody` before applying a JSON body parser, and do not enqueue or process any webhook until verification succeeds. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
setup.md:38
Finding

Persistent Plaintext Storage of Phone Numbers and Account Metadata

Content
View full analysis
## Phone Numbers ## Templates ## Webhook ## Preferences ## Notes ``` ### Technical Analysis The skill instructs the agent to create a durable plaintext file under the user's home directory. The proposed content includes personally identifying and operationally sensitive information: - Registered telephone numbers - WhatsApp phone-number identifiers - Business type and use case - Frequently used message templates - Webhook endpoint URLs - Beha ...[truncated 1732 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (21)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## Authentication

**Required environment variables:**
- `WHATSAPP_ACCESS_TOKEN` — System User access token (permanent) or User access token (60-day)
- `WHATSAPP_PHONE_NUMBER_ID` — Your registered phone number ID
- `WHATSAPP_BUSINESS_ACCOUNT_ID` — Your WABA ID (for templates)
- `WHATSAPP_APP_SECRET` — App secret for webhook verification

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · best-practices.md (reported line 224)May include surrounding context.

md
## Authentication

**Required environment variables:**
- `WHATSAPP_ACCESS_TOKEN` — System User access token (permanent) or User access token (60-day)
- `WHATSAPP_PHONE_NUMBER_ID` — Your registered phone number ID
- `WHATSAPP_BUSINESS_ACCOUNT_ID` — Your WABA ID (for templates)
- `WHATSAPP_APP_SECRET` — App secret for webhook verification

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · setup.md (reported line 31)May include surrounding context.

md
1. **Meta Business Account** at business.facebook.com
2. **WhatsApp Business Account (WABA)** — created in Meta Business Suite
3. **System User** with WhatsApp permissions
4. **Access Token** — generate from System User

Key IDs to collect:
- Phone Number ID (from WhatsApp Manager)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Quick Start

bash
curl -X POST "https://graph.facebook.com/v21.0/$WHATSAPP_PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"messaging_product":"whatsapp","to":"1234567890","type":"text","text":{"body":"Hello!"}}'

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The 'When to Use' section says 'Any WhatsApp Business operation,' followed by a very wide list of actions, without defining boundaries, exclusions, or specific trigger phrases. For a markdown skill description, this is ambiguous enough to overlap with many ordinary requests involving WhatsApp and may cause unintended invocation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Get Profile

bash
curl "https://graph.facebook.com/v21.0/$WHATSAPP_PHONE_NUMBER_ID/whatsapp_business_profile?fields=about,address,description,email,profile_picture_url,websites,vertical" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation includes two-step verification enable/disable operations, including a DELETE request to disable protection, but does not warn about the security impact, authorization requirements, or reversibility concerns. In an agent skill context, this can encourage unsafe execution of account-security-changing actions without adequate user confirmation or safeguards.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · business.md (reported line 160)May include surrounding context.

Enable

bash
curl -X POST "https://graph.facebook.com/v21.0/$WHATSAPP_PHONE_NUMBER_ID" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pin": "123456"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown describes receiving webhook responses containing personal data such as full name, email, and phone number, and earlier examples show those fields being submitted in flow payloads. The document does not include any warning or disclosure about privacy implications, consent, or secure handling of collected user data, which is expected for markdown guidance covering data-affecting behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · flows.md (reported line 347)May include surrounding context.

Create Flow via API

bash
curl -X POST "https://graph.facebook.com/v21.0/$WHATSAPP_BUSINESS_ACCOUNT_ID/flows" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly supports sending and requesting precise location data but provides no privacy warning, consent requirement, or guidance on data minimization/retention. In a messaging/business context, location data is sensitive personal information and could enable tracking, stalking, or misuse if agents implement these examples without user notice or explicit permission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill shows how to send contacts containing names, phone numbers, and email addresses without any warning about handling personal data. In a business messaging integration, this can normalize sharing third-party PII without consent, increasing the risk of privacy violations, data leakage, and improper disclosure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setup text asks whether the assistant should help 'whenever WhatsApp comes up, or only when you ask,' which creates an overly broad activation scope. That can cause the skill to engage on loosely related conversations and collect or act on business context without a clear user-triggered boundary, increasing the chance of unintended data handling or actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs storing business context locally in ~/whatsapp-business-api/memory.md, including phone numbers and webhook URLs, without warning about persistence, access controls, or sensitivity. Even if these are not secrets by themselves, they are operationally sensitive and could expose business infrastructure or customer-contact metadata if the local file is accessed by other users, tools, or malware.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

List Templates

bash
curl "https://graph.facebook.com/v21.0/$WHATSAPP_BUSINESS_ACCOUNT_ID/message_templates" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file repeatedly specifies the template language as "en_US" in examples, which can signal a default forced locale in natural-language guidance without mentioning user choice or regional scope. Under the language/locale policy, hard-coded locale constraints should either be optional, user-selectable, or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The send-template examples specify "en_US" as the language code and do not note that this should be adapted based on the recipient's language or deployment context. This presents a locale-specific default without opt-in or justification, which fits the policy's language/locale concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file includes a DELETE request that removes a WhatsApp message template, but the surrounding documentation does not warn that the action is destructive or advise users to verify the template name before running it. For markdown files, destructive operations affecting system state should be accompanied by clear user-facing warnings about impact and reversibility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The webhook examples include realistic message content, contact identifiers, and precise location data, but the documentation does not warn implementers that these payloads contain personal and potentially sensitive data requiring secure handling. In the context of a WhatsApp Business webhook integration skill, this omission can lead developers to log, store, or process user communications and location information insecurely, increasing privacy, compliance, and data exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The request example hard-codes "language": "en" for the display name change flow, which imposes a specific language selection without offering user opt-in or documenting why English is required. This is a natural-language locale policy concern because the example suggests a fixed language rather than a user-selected or context-justified one.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The markdown includes a Delete Media section with a DELETE request example, but it provides no warning that the operation removes media and may be irreversible. For markdown files, destructive behaviors that could affect user data should be accompanied by an explicit warning or caution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.