Skip to content

πŸ› discord (v5): RFC notices and notifications ping @everyone/roles from issue titles β€” port allowed_mentions fix (#9214)Β #15870

Closed

Description

@hanthor

Problem

On v5, the Discord posts hive sends carry no allowed_mentions. Anyone who can open an issue in a managed repo controls text that hive reposts. A title such as RFC: @everyone …, or one containing <@&ROLE_ID>, therefore pings the whole server or the whole role when hive posts it.

The most direct path is the RFC lifecycle notifier (#14616 / #14617, v5 only). rfcnotify.Format puts the raw issue title into RFC opened: #N <title> …. That line goes to #architecture-rfcs through Bot.SendMessageTo. Any issue whose title starts with RFC qualifies.

#9128 fixed this class of bug in #9214 (4980b73bb, suppress mentions in outbound chat notifications). That issue was scoped "v6 only, do not backport". The RFC notifier landed on v5 afterwards and reuses the unfixed v5 sender.

Where (v5)

Path Payload today v6 equivalent
src/pkg/discord/bot.go:201 SendMessageTo: the only bot POST; SendMessage and the drain queue go through it {"content": …} bot.go:183 adds "allowed_mentions": {"parse": []}
src/pkg/notify/notify.go:155 sendDiscordWebhook {"content": …, "flags": SUPPRESS_EMBEDS} notify.go:166 adds "allowed_mentions": {"parse": []}

Untrusted text that reaches these senders includes:

  • RFC titles (src/cmd/hive/rfcnotify_wire.go:85)
  • notifier messages built from issue titles and agent output

Fix

Port #9214's two payload changes to v5. Add "allowed_mentions": {"parse": []} to both payloads.

  • Literal @everyone, @here and <@…> text still appears in the post; it just no longer pings anyone.
  • The fix leaves message wording alone and needs no config change.
  • The bot never pings deliberately on v5, so nothing is lost.

Acceptance

  • A test on SendMessageTo asserts that the request body has allowed_mentions.parse == []. Use the httptest server pattern from src/pkg/discord/bot_test.go.
  • A matching test on sendDiscordWebhook asserts the same.
  • An RFC titled RFC: @everyone test posts the literal text and pings nobody.
  • changelog.d/security-discord-suppress-mentions.md fragment.

Related

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    priority/mediumMust be staffed and worked on either currently, or very soon, ideally in time for the next release.
    kind/bugCategorizes issue or PR as related to a bug.
    on Oct 30, 2026
  2. hivecommons-hive commented on Oct 30, 2026

    @hivecommons-hive
    Contributor

    πŸ”’ Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  3. hivecommons-hive commented on Oct 30, 2026

    @hivecommons-hive
    Contributor

    πŸ”“ Claim by agent scanner released (holding agent relaunched).

  4. github-actions commented on Oct 30, 2026

    @github-actions
    Contributor

    @hanthor this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it β€” check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you β€” you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

  5. added
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed on Oct 30, 2026
  6. hivecommons-hive commented on Oct 30, 2026

    @hivecommons-hive
    Contributor

    Fixed by #15874 (#15874, merged). Closing because Hive's PR claim metadata says this PR was the full fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationkind/bugCategorizes issue or PR as related to a bug.priority/mediumMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions