T09 · Insecure Skill Coding Practices
- Location
references/CONFIG.md:96- Finding
Webhook Secret May Be Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
references/CONFIG.md, lines 96-105
Vulnerability Type: Insecure secret transmission
Risk Level: MediumVulnerable Code
yaml channels: discord: plugin: discord token: "YOUR_BOT_TOKEN" webhook: enabled: true path: /webhook/discord secret: "random-secret-string"The subsequent setup instruction states:
text Include secret in webhook headers or query paramsTechnical Analysis
The documentation permits an inbound webhook secret to be placed in URL query parameters. Query strings are frequently recorded by reverse proxies, web servers, application access logs, monitoring platforms, analytics systems, browser histories, and intermediary infrastructure.
Consequently, a valid webhook secret may become visible to systems or personnel that do not otherwise require access to it. The example also uses the generic value
random-secret-stringwithout specifying cryptographically secure generation, minimum entropy, request signing, expiration, or replay protection.Authentication through a dedicated header is safer than query-string authentication, but a static header secret alone does not provide message integrity or replay resistance. A robust webhook design should authenticate the request body using a keyed signature and reject stale or repeated requests.
Attack Path
- An administrator follows the documented option and includes the webhook secret in the callback URL's query string.
- Discord, a reverse proxy, the gateway, or an observability platform records the complete request URL.
- An attacker or low-privilege operator with access to those logs obtains the secret.
- The attacker sends crafted requests to
/webhook/discordusing the disclosed secret. - If the gateway treats the request as an authentic Discord event, the attacker can forge inbound events or trigger downstream message-process ...[truncated 584 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to transmit webhook secrets through query parameters.
- Require authentication data to be sent through a dedicated authorization or signature header.
- Sign the raw request body with HMAC-SHA-256 or use the platform's official signature-verification mechanism.
- Include a timestamp and unique request identifier in the signed material.
- Reject stale timestamps and previously processed request identifiers to prevent replay attacks.
- Compare signatures using a constant-time comparison function.
- Require HTTPS and reject insecure HTTP webhook endpoints.
- Instruct administrators to generate webhook secrets with a cryptographically secure random-number generator and sufficient entropy.
- Ensure secrets and authorization headers are redacted from application, gateway, proxy, and monitoring logs.
- Document immediate secret rotation procedures for suspected exposure.
