T09 · Insecure Skill Coding Practices
- Location
index.ts:925- Finding
Discord Webhook Credentials Exposed in Tool Responses
- Content
View full analysis
Vulnerability Details
File Location:
index.ts, lines 925–933
Vulnerability Type: Sensitive credential exposure
Risk Level: HighVulnerable Code
ts webhooks: hooks.map((hook: any) => ({ id: hook.id, name: hook.name, channelId: hook.channelId, url: hook.url, })),The guild-level
webhook-listbranch immediately following this code returns the same sensitivehook.urlproperty.Technical Analysis
Discord webhook URLs contain an identifier and secret token that authorize unauthenticated webhook operations. They must therefore be treated as credentials rather than ordinary resource metadata.
The
webhook-listaction serializes each complete webhook URL into the tool response. The sharedjson()response helper places the data in both textual tool content and thedetailsfield. This can expose the credential to the language model context, conversation history, tool telemetry, application logs, or downstream integrations.Listing webhooks only requires non-secret metadata such as the webhook ID, name, and channel ID. Returning the credential-bearing URL exceeds the minimum data exposure necessary for the declared listing functionality.
Attack Path
- An attacker, untrusted prompt, or compromised workflow induces the agent to invoke
discord_adminwith thewebhook-listaction. - The plugin retrieves the channel or guild webhooks using the privileged Discord bot.
- The plugin returns each complete
hook.urlin the tool response. - The attacker obtains the response through agent output, logs, telemetry, or another consumer of tool results.
- The attacker extracts the webhook token from the URL.
- The attacker submits requests directly to the Discord webhook without possessing the bot token.
- The webhook remains usable until it is deleted or its token is rotated.
Impact Assessment
Exposure grants the ability to authenticate as each disclosed web ...[truncated 353 chars]
- An attacker, untrusted prompt, or compromised workflow induces the agent to invoke
- Remediation
View remediation
Remediation Suggestions
- Remove
urlfrom allwebhook-listresponses. - Return only non-secret metadata such as
id,name,channelId, and webhook type. - Treat Discord webhook URLs as credentials in logging and redaction policies.
- If URL disclosure is genuinely required, implement a separate operation requiring explicit authorization and confirmation.
- Prevent credential-bearing responses from being written to ordinary logs or telemetry.
- Rotate or recreate any webhooks whose URLs may already have been exposed through tool history.
- Add automated tests asserting that webhook list responses never contain token-bearing URLs.
- Remove
