T09 · Insecure Skill Coding Practices
- Location
scripts/whatsapp_client.py:47- Finding
Basic Authentication Credentials Can Be Disclosed to a Caller-Controlled API Origin
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real EngageLab WhatsApp API helper, but it handles high-impact messaging credentials and business resources with under-scoped safeguards.
Review before installing. Use only with scoped EngageLab credentials, do not override the API base URL except in a controlled test environment with non-production keys, confirm exact templates before deletion, and add independent webhook protections such as a shared-secret gateway, schema validation, replay checks, and rate limiting before trusting callbacks.
scripts/whatsapp_client.py:47Basic Authentication Credentials Can Be Disclosed to a Caller-Controlled API Origin
references/callback-api.md:15Callback Integration Guidance Requires an Unauthenticated Webhook Endpoint
The code substantially matches the declared messaging and template-management capabilities: it authenticates, constructs requests, handles errors, sends all listed message types, and performs template CRUD/list/get operations against EngageLab WhatsApp endpoints. However, the description also claims callback webhook handling and callback configuration, which are not present in this code chunk. There are no webhook server routes, handlers, signature validation, callback registration methods, or related logic. Therefore the description overstates the implemented capabilities in a material way, producing a description-behavior mismatch.
The documented delete operation targets a template name and states that it deletes all languages for that name, which creates a high-risk destructive action from a potentially ambiguous user input. In an agent setting, this can lead to bulk deletion of multiple templates when the user may have intended to remove only one localized variant or review the target first.
**Update** — `PUT /v1/templates/:templateId` (same body as create)
**Delete** — `DELETE /v1/templates/:templateName` (deletes all languages for that name)
### Template Categories
Using a destructive DELETE operation keyed only by templateName creates a parameter-abuse risk because a simple, human-guessable identifier can trigger deletion of multiple resources at once. In this skill, an LLM-driven agent may select or transform names incorrectly, causing overbroad or unauthorized destructive actions against WhatsApp business templates.
## 5. Delete Template
`DELETE /v1/templates/:templateName`
Pass the **template name** (not ID) in the URL path. This deletes all language variants of that template.
The skill documents network-capable behavior against an external API but does not declare any explicit tool scope or allowed-tools constraints. In an agent environment, that omission weakens policy enforcement and can allow unintended outbound requests or broader tool access than users expect.
The trigger phrases are broad enough to activate on generic 'WhatsApp' or 'WhatsApp API' requests, which can cause the wrong skill to be selected and prompt unnecessary use of external messaging functionality. Misrouting in this context is risky because the skill deals with credentials, recipient phone numbers, and outbound communications to a third-party service.
The skill lacks an explicit warning that recipient identifiers, message bodies, media links, and possibly template data will be transmitted to an external provider. Without that disclosure, users may unknowingly expose sensitive personal or business data to a third-party API and webhook flow.
The documentation explicitly instructs users to expose a webhook endpoint that does not require authentication because the callback security mechanism is 'pending'. That creates a true vulnerability: any internet client could forge callback requests, inject fake delivery or reply events, trigger business logic, pollute audit trails, or abuse downstream automation that trusts webhook contents.
The documentation states that deleting by template name removes all language variants, but it does not prominently warn users about this broad destructive effect or require a safer confirmation pattern. In an agent skill context, this can lead to unintended bulk deletion if the agent or user assumes only a single localized template will be removed.
The constructor accepts a developer key and secret, encodes them into a Basic Authorization header, and uses them for all outbound API calls. Although this is functionally expected for an API client, the file does not include any warning or disclosure about handling sensitive credentials or sending them to a remote service.
This code sends payloads containing recipient numbers, message bodies, and template data to an external WhatsApp API via HTTP requests. While the module docstring describes API usage, there is no runtime confirmation, logging, or explicit warning that user-provided data will be transmitted off-system.
No suspicious patterns detected.