mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2369] [Issue]: Discord webhook mirror sends model/card content with no allowed_mentions, enabling @everyone / mass-mention injection #1168
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2369
Originally assigned to: @Romuromylus on GitHub.
Summary
Severity: Low — injection (notification abuse).
When Discord mirroring is enabled for a chat, every assistant turn is mirrored to the webhook with no
allowed_mentionsfield. Discord webhooks parse mentions incontentby default, so any@everyone/@here/<@&roleId>/<@userId>string the model emits (or that an imported card steers it into emitting) fires real Discord mentions, mass-pinging the mirrored server/role/user.Expected behavior
The webhook payload should always set
allowed_mentions: { parse: [] }(Discord's documented way to suppress all mentions regardless of content), so mirrored model output cannot trigger pings the user did not intend.Actual behavior
discord_webhook_send(src-tauri/src/commands/storage/integrations/discord.rs:16-34) builds the payload withcontent/username/avatar_urland never setsallowed_mentions:The untrusted-input → sink path: saved assistant message content (model output) →
mirrorDiscordMessage(src/engine/generation/start-generation.ts:392-420,content = args.content.trim()with no mention stripping) →integrationGateway.discord.mirrorMessage(src/shared/api/integration-gateway.ts:65-72) → Tauridiscord_webhook_send→ POST todiscord.com/api/webhooks/.... A grep confirms zeroallowed_mentions/allowedMentionsoccurrences anywhere insrc/orsrc-tauri/. The outbound-URL fields here are hardened (is_valid_discord_webhook_url+is_allowed_outbound_url), but that is SSRF defense — there is no mention-suppression guard on the content body.Blast radius is low: mirroring is opt-in and off until the user pastes a webhook URL into chat settings, the webhook targets a channel the user controls and opted into, and
@everyoneonly fires if that channel grants the webhook mention rights. Impact is notification-spam / mass-ping in the user's own mirrored channel, not exfil or code execution.Steps to reproduce
@everyone(e.g. via a jailbreak or an imported card steering it).@everyoneping in the channel.Impact area
Environment
330f69a8Logs, screenshots, or video
Static source audit. Cited:
integrations/discord.rs:16-34(payload, noallowed_mentions); feederstart-generation.ts:392-420(no mention stripping),integration-gateway.ts:65-72; grep confirms zeroallowed_mentionsoccurrences acrosssrc/andsrc-tauri/.Regression notes
Found via static audit; not a regression. The web build's
postToDiscordWebhook(packages/server/src/services/discord-webhook.ts) builds{ content, username?, avatar_url? }with the identical missingallowed_mentions, so main has the same gap and the refactor neither broke nor inverted it.Additional context
In
discord_webhook_send, always insertpayload.insert("allowed_mentions".to_string(), json!({ "parse": [] }));— Discord's documented mention-suppression for any content. Optionally also strip@everyone/@hereinmirrorDiscordMessageas defense-in-depth. The sibling outbound-URL validation on this same command is the model to follow — the content body just lacks an equivalent guard.Template check
@Romuromylus commented on GitHub (Jun 6, 2026):
Fixed by #2375, merged into
refactor(squash96686c79).