0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-13 13:17:29 +08:00
discourse/plugins/chat/app
Joffrey JAFFEUX 71f57d1d9a SECURITY: Harden chat DM channel creation and expansion [backport 2026.1]
Backport of #473 to release/2026.1.

---

Two issues fixed:

1. **Group visibility bypass** — the `target_groups` parameter was passed directly to the user resolution query without checking group or member visibility for the acting user. An authenticated chat user could craft an API request with a known private/hidden group name and receive a channel containing that group's members, leaking their identities. Fix: filter `target_groups` through `visible_groups` and `members_visible_groups` scopes before resolving users in both `CreateDirectMessageChannel` and `AddUsersToChannel` services.

2. **Chat-disabled user bypass** — `can_chat?` only checked group membership, not the `chat_enabled` user preference. A chat-disabled user could create or query DM channels between other users via the direct messages API, potentially exposing private `last_message` content. Fix: add `chat_enabled` check to `can_chat?` and add an actor inclusion guard in `fetch_target_users` so the service fails if the acting user gets filtered out of the resolved user set.

---

**Security Advisory:** https://github.com/discourse/discourse/security/advisories/GHSA-2m5j-6v2r-cq2h
2026-03-31 15:12:50 +01:00
..
controllers/chat SECURITY: Respect group visibility in category chatables when accessed by a moderator [backport 2026.1] 2026-03-31 15:12:50 +01:00
jobs DEV: Delete dead AutoJoinChannelBatch job 2026-01-28 03:14:32 +00:00
models SECURITY: Harden chat DM channel creation and expansion [backport 2026.1] 2026-03-31 15:12:50 +01:00
queries/chat FIX: removes an N+1 in channel with user options (#36773) 2025-12-26 23:59:09 +01:00
serializers/chat UX: Hide "My Threads" when user has no threads (#36931) 2026-01-21 10:56:24 +01:00
services/chat SECURITY: Harden chat DM channel creation and expansion [backport 2026.1] 2026-03-31 15:12:50 +01:00
validators/chat FEATURE: Add setting to prevent anonymous users from using chat (#31842) 2025-03-21 13:32:52 +03:00
views PERF: fix performance of chat email notifications 2024-06-10 14:25:06 +02:00