Discord Notificationsfor WHMCS · Documentation
v2.0.0

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/vN prefix.
  • Host must be discord.com, discordapp.com or 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

SettingValue
RedirectsDisabled (CURLOPT_FOLLOWLOCATION = false)
Peer verificationEnabled
Host verificationEnabled, strict (2)
ProtocolsHTTPS only (CURLPROTO_HTTPS)
Connect timeoutAt most 5 seconds
Request timeout1–30 seconds, default 10
User agentWHMCS-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: and data: URLs are discarded.
  • Markdown control characters in labels and link labels are escaped.

Permissions

PermissionNeeded byNotes
Manage WebhooksAdministratorCreate or copy the webhook. Not needed by WHMCS after setup.
View ChannelWebhookThe webhook can only post to a channel it can see.
Send MessagesWebhookRequired for every format.
Embed LinksWebhookRequired 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.