Security & Permissions
The webhook URL is the only credential. Validation, redaction and mention suppression protect it and the channel.
Webhook validation
The URL is validated before every request, including per-rule overrides that were edited independently of the provider.
- Must parse and use HTTPS.
- No username or password in the URL.
- No fragment and no control characters or whitespace.
- Port 443 only, unless a custom host is explicitly allowed.
- No query string on a Discord URL.
- Path must match
/api/webhooks/{numeric id}/{token}, optionally with an/api/vNprefix. - Host must be
discord.com,discordapp.comor one of their subdomains, unless Allow Custom Host is enabled.
The module rejects a URL instead of trying to repair it. A URL copied from Discord always passes; a channel link or an OAuth URL never does.
Transport hardening
| Setting | Value |
|---|---|
| Redirects | Disabled (CURLOPT_FOLLOWLOCATION = false) |
| Peer verification | Enabled |
| Host verification | Enabled, strict (2) |
| Protocols | HTTPS only (CURLPROTO_HTTPS) |
| Connect timeout | At most 5 seconds |
| Request timeout | 1–30 seconds, default 10 |
| User agent | WHMCS-Discord-Notifications/2.0.0 |
Token redaction
The module log records the webhook URL as https://discord.com/api/webhooks/{id}/[redacted]. The secret token is never written to a log entry, an error message, this documentation or the README. The webhook ID is kept because it identifies which channel failed without exposing the credential.
If the token is exposed outside WHMCS, delete the webhook in Discord and create a new one. Updating the URL in the provider is enough; no rule edit is needed unless a rule uses an override.
Mention safety
Client names, ticket subjects and message bodies are untrusted text. Every payload disables mentions through allowed_mentions, and the strings @everyone and @here are rewritten with a zero-width space. A customer cannot make a notification ping a channel, a role or a user.
Attribute safety
- HTML is stripped from every title, message and attribute.
- HTML entities are decoded before Markdown escaping, so
&cannot render literally. - Empty attribute values are dropped; Discord never receives an invalid field.
- Only HTTP(S) attribute URLs become Markdown links.
javascript:anddata:URLs are discarded. - Markdown control characters in labels and link labels are escaped.
Permissions
| Permission | Needed by | Notes |
|---|---|---|
| Manage Webhooks | Administrator | Create or copy the webhook. Not needed by WHMCS after setup. |
| View Channel | Webhook | The webhook can only post to a channel it can see. |
| Send Messages | Webhook | Required for every format. |
| Embed Links | Webhook | Required for Message + Embed and Embed only. |
| Mention Everyone | — | Not required; mentions are suppressed. |
Stored data
WHMCS stores the provider settings in tblnotificationproviders.settings and each rule in tblnotificationrules.provider_config. The webhook token is part of that stored JSON. Protect database backups and restrict admin access accordingly. The module creates no tables of its own.