Advisory

PYSEC-2026-3506

Details, part 2 of 2. The advisory

Details

Remediation

Recommended fixes:

  1. For Discord, require approvals to be tied to the request, not merely any later channel message. Use Discord interactions/buttons with opaque server-side request ids, or require a Discord reply whose message_reference.message_id matches the approval message.
  2. Add explicit approver identity configuration to all messaging approval backends, for example approver_user_ids or allowed_approvers.
  3. Reject approvals from users outside the configured approver set, even if the message appears in the configured channel.
  4. Include a per-request nonce or opaque approval id in callbacks and verify it server side before returning ApprovalDecision(approved=True).
  5. Add regression tests for Discord where:
  • an unrelated later yes in the channel is ignored;
  • a reply from a non-approver is ignored;
  • a request-bound reply/callback from an allowed approver succeeds.

Sources & licences