0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 12:09:27 +08:00
discourse/plugins/chat/app
discoursebot e8487e59b2
SECURITY: Enforce chat message length before cooking it [backport 2026.1] (#41753)
Backport of #41725 to release/2026.1.

---

Chat::CreateMessage and Chat::UpdateMessage cooked the full,
attacker-controlled message (markdown-it rendering in V8) before the
chat_maximum_message_length limit was enforced at save!. A single
low-privilege request with an oversized body could burn tens of seconds
of worker CPU on rendering that was immediately discarded as too long,
enabling denial of service against the shared worker pool.

Validate the message length in the service contract, which runs before
the message is cooked, so oversized input is rejected without the
expensive rendering. The model-level length validation remains as
defense in depth. The guard covers the create, edit, and
Slack-compatible incoming-webhook paths, which all route through these
services.

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2026-07-16 11:10:40 +08:00
..
controllers/chat SECURITY: Channel member list exposes other users' chat read state and notification settings [backport 2026.1] (#40888) 2026-06-15 11:13:20 -05: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 SECURITY: Channel member list exposes other users' chat read state and notification settings [backport 2026.1] (#40888) 2026-06-15 11:13:20 -05:00
services/chat SECURITY: Enforce chat message length before cooking it [backport 2026.1] (#41753) 2026-07-16 11:10:40 +08: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