Back to skill

Security audit

farid wa

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its WhatsApp Business purpose, but it gives agents high-impact send/delete authority and includes unsafe examples for handling API keys and OAuth URLs.

Review before installing if this will be used with a real WhatsApp Business account. Use a narrowly scoped Maton key where possible, never print or paste the full API key, treat connection authorization URLs as secrets, and require explicit confirmation of recipients, phone-number IDs, template names, media IDs, and connection IDs before sending, updating, or deleting anything.

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
SKILL.md:601
Finding
API Key Disclosure Through Troubleshooting Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:601-604` **Vulnerability Type**: Credential exposure through terminal and log output **Risk Level**: Medium ### Vulnerable Code ```bash 1. Check that the `MATON_API_KEY` environment variable is set: ```bash echo $MATON_API_KEY ``` ``` ### Technical Analysis The troubleshooting instructions recommend printing the complete `MATON_API_KEY` value to standard output. This does more than verify whether the environment variable is configured: it exposes the credential in plaintext. Terminal output may be retained in shell transcripts, CI/CD logs, remote-support sessions, Agent conversation histories, screen recordings, or centralized monitoring systems. It may also be copied into issue reports or support conversations while troubleshooting. Because the API key is used as a bearer credential for `gateway.maton.ai` and `ctrl.maton.ai`, possession of the value may be sufficient to authenticate requests without any additional proof of identity. ### Attack Path 1. A user encounters an authentication problem and follows the documented troubleshooting procedure. 2. The user runs `echo $MATON_API_KEY`. 3. The complete bearer credential appears in terminal output. 4. The output is captured by logs, an Agent transcript, screen sharing, or a copied diagnostic report. 5. An unauthorized party obtains the exposed value. 6. The party submits the key in an `Authorization: Bearer` header to Maton endpoints. 7. Subject to the key's server-side permissions, the party can interact with associated WhatsApp connections and resources. ### Impact Assessment Successful exploitation may allow unauthorized use of the Maton account and its connected WhatsApp Business resources. The accessible scope depends on the privileges assigned to the exposed API key, but documented operations include listing and deleting connections, sending WhatsApp messages, managing templates, accessing media metadata, and modifying business-pr ...[truncated 188 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace direct credential printing with a presence-only check: ```bash if [ -n "${MATON_API_KEY:-}" ]; then echo "MATON_API_KEY is configured" else echo "MATON_API_KEY is not configured" fi ``` - If diagnostic identification is necessary, display only a short, non-sensitive fingerprint rather than any reusable portion of the key. - Add an explicit warning that API keys must not be pasted into Agent conversations, support tickets, screenshots, or logs. - Ensure CI/CD systems mask `MATON_API_KEY` and other bearer credentials. - Recommend rotating the API key immediately if it has been printed into a retained or shared output channel. - Where supported, use narrowly scoped, short-lived credentials and enforce server-side revocation and expiration. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:91
Finding
OAuth Session URL Disclosure Through Unredacted Connection Responses<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:91-116` **Vulnerability Type**: Sensitive OAuth session-token disclosure through unredacted output **Risk Level**: Medium ### Vulnerable Code ```python ### Get Connection ```bash python <<'EOF' import urllib.request, os, json req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}') req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}') print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2)) EOF ``` **Response:** ```json { "connection": { "connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80", "status": "ACTIVE", "creation_time": "2025-12-08T07:20:53.488460Z", "last_updated_time": "2026-01-31T20:03:32.593153Z", "url": "https://connect.maton.ai/?session_token=...", "app": "whatsapp-business", "metadata": {} } } ``` Open the returned `url` in a browser to complete OAuth authorization. ``` ### Technical Analysis The example prints the complete connection response without filtering or redaction. The documented response includes a browser URL containing a `session_token` query parameter. Query-string tokens are bearer-like secrets and can be exposed through terminal output, Agent transcripts, copied diagnostics, browser history, proxy logs, and referrer data. The documentation explicitly directs the user to open the returned URL to complete OAuth authorization, demonstrating that the token has security-sensitive workflow authority. Printing the entire response unnecessarily broadens exposure beyond the browser process that needs the authorization URL. The network flow itself is consistent with the Skill's declared managed-OAuth functionality. The vulnerability is the unredacted handling and display of the session-bearing response, not the disclosed use of Maton's gateway. ### Attack Path 1. A user requests connection information using the documented example. 2. The script retrieves a response from `ctrl.ma ...[truncated 1078 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not print complete connection objects when they may contain session-bearing URLs. - Extract only non-sensitive fields needed for diagnostics, such as connection ID, application name, and status. - If the authorization URL must be presented, open it through a controlled browser handoff without writing it to persistent logs. - Redact sensitive query parameters before displaying responses: ```python from urllib.parse import urlsplit, urlunsplit response = json.load(urllib.request.urlopen(req)) connection = response.get("connection", {}) safe_output = { "connection_id": connection.get("connection_id"), "status": connection.get("status"), "app": connection.get("app"), "authorization_url_available": bool(connection.get("url")), } print(json.dumps(safe_output, indent=2)) ``` - Mark OAuth session URLs as secrets in the documentation and warn users not to share them. - Ensure session tokens are short-lived, single-use, bound to the initiating user and connection, and invalidated after completion. - Configure application, proxy, and monitoring logs to redact sensitive URL query parameters. - Advise users to cancel the pending connection and create a new session if an authorization URL is exposed. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Media

```bash
DELETE /whatsapp-business/v21.0/{media_id}
```

### Message Templates
Confidence
87% confidence
Finding
The documented DELETE media endpoint can permanently remove resources if an agent is induced to pass an attacker-chosen media_id or acts without confirmation. In an agent/tooling context, destructive parameterized endpoints increase the risk of unauthorized deletion or operational disruption.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Template

```bash
DELETE /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates?name=template_name
```

### Phone Numbers
Confidence
89% confidence
Finding
The delete-template endpoint allows destructive action based on a user-supplied template name and account identifier, creating risk of accidental or manipulated deletion of messaging templates. In production workflows, this could break customer communications or compliance-approved messaging flows.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill prominently documents actions that send messages, upload media, and modify external WhatsApp resources, but it does not include clear user-consent or impact warnings near those examples. In an agent setting, this increases the risk of unintended external communications or destructive actions being performed on behalf of a user without adequate notice.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The delete examples for connections and media are operationally destructive, yet the documentation does not warn that they may revoke access, disrupt automations, or permanently remove resources. In agent-driven use, omission of such warnings can cause accidental service interruption or data loss.

External Transmission

Medium
Category
Data Exfiltration
Content
};

// Send text message
await fetch(
  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
  {
    method: 'POST',
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
};

// Send text message
await fetch(
  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
  {
    method: 'POST',
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}

# Send text message
response = requests.post(
    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
    headers=headers,
    json={
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}

# Send text message
response = requests.post(
    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
    headers=headers,
    json={
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}

# Send text message
response = requests.post(
    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
    headers=headers,
    json={
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}

# Send text message
response = requests.post(
    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',
    headers=headers,
    json={
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
93% confidence
Finding
Telling users to echo the API key directly can expose the credential on shared terminals, screen recordings, logs, or shell history, increasing the chance of credential theft. Although it is framed as troubleshooting, it normalizes unsafe secret handling.

Static analysis

Detected: suspicious.exposed_resource_identifier

Example code exposes a concrete connection_id instead of a placeholder.

Critical
Code
suspicious.exposed_resource_identifier
Location
SKILL.md:105