# Permission Bypass in Explicit Media Endpoints leading to Private Message Leakage

Discord's explicit-media scan endpoint lacked channel permission checks, letting attackers fetch message objects from unauthorized channels, DMs, and threads using known IDs.

- Payout: $2,000
- Severity: high
- Program: Discord
- Found by: darkerink
- Disclosed: 2026-01-13
- Write-up quality: 7/10
- Original: https://bugcrowd.com/disclosures/9e02d0a1-b625-4b11-966e-757e8fc43cca/permission-bypass-in-explicit-media-endpoints-leading-to-private-message-leakage
- Library page: https://bugbountylibrary.com/r/bc%3A5cb33ff7-4e4b-4f2a-b943-5fdc9c4f6f38
- Tags: area:web domain:api impact:data-leak impact:pii-leak kind:bounty platform:bugcrowd sev:high tech:rest technique:chained vuln:access-control vuln:idor vuln:info-disclosure

**Target:** Explicit Media scanning API endpoint (/messages/explicit-media)
**Root cause:** The explicit-media scan endpoint failed to enforce VIEW_CHANNEL and READ_MESSAGE_HISTORY permissions, returning full message objects for any message_id/channel_id pair supplied.
**Steps:**
1. Poll `/guilds/:guildId/channels` to obtain `last_message_id` values updated live as users send messages.
2. Send `PATCH /messages/explicit-media` with body `{"messages":[{"message_id":"...","channel_id":"..."}]}`.
3. Receive MESSAGE_UPDATE gateway events containing message objects from channels/DMs/threads the attacker cannot access.
**How found:** Researcher examined the explicit-media scanning endpoint and noticed it accepted arbitrary message_id/channel_id pairs without permission validation; combined with the live last_message_id leak from the channels listing to source valid IDs.
**Exploitation:** Attacker harvests message IDs from the channels listing endpoint, then submits them to the explicit-media scan endpoint which returns message content via gateway MESSAGE_UPDATE events, bypassing channel access controls to read private messages.
**Insight:** Media/scanning endpoints that accept message or object IDs often skip the authorization checks the normal read path enforces—test auxiliary endpoints (scan, preview, embed, export) with IDs harvested from listing APIs that leak last_message_id.

## Proof of concept (copied exactly from the original report)

**PATCH request to explicit-media endpoint with message IDs**

```
Once the attacker has the message IDs they want, they could send a PATCH request to /messages/explicit-media with a body of

{
 "messages": [
 {
 "message_id": "...",
 "channel_id": "..." 
 }
 ]
}
```

