Summary
Discourse chat events for public category channels are published to the internal MessageBus without properly scoping permissions.
As a result, any MessageBus subscriber, even without chat enabled, can receive real-time chat message payloads they are not intended to see.
Affected context
This vulnerability appears in Discourse deployments that use the chat feature alongside the MessageBus mechanism to deliver real-time updates.
It becomes relevant where multiple internal or external consumers subscribe to MessageBus channels and at least some of those consumers are not supposed to access chat content.
The issue arises when chat events for public category channels are broadcast on MessageBus topics that do not enforce per-subscriber permission checks or feature flags, causing overexposure of chat payloads to otherwise unauthorized subscribers.
Exploit preconditions
- Attack surface: Internal MessageBus subscription interface or any component capable of subscribing to Discourse MessageBus channels.
- Required access: Ability to subscribe to MessageBus channels in the affected Discourse instance (e.g., as an integrated service, plugin, or internal user process).
- Trigger point: Reception of chat-related events for public category channels published on MessageBus without permission-aware scoping.
- Why exploitation is possible: Chat messages are published to generic MessageBus streams without verifying that the subscriber has chat enabled or appropriate permissions, allowing unauthorized consumers to receive message payloads.
Why this happens
The root cause is an authorization gap in event broadcasting logic, aligned with CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Chat events destined for users with appropriate permissions are pushed onto MessageBus channels that are overly broad or insufficiently scoped by capability (e.g., chat enabled vs. not enabled).
Instead of evaluating permissions at publish or subscription time, the system implicitly trusts that any subscriber to the channel is allowed to view chat content, leading to unintended data exposure through internal messaging infrastructure.
Potential impact
- Unauthorized recipients may view real-time chat message content.
- Internal integrations or plugins can log or persist chat payloads beyond their intended audience.
- Chat metadata (authors, timestamps, channels) could be exposed and correlated for user activity profiling.
- Leakage of potentially sensitive or confidential information shared in "public" channels that were assumed to be limited to chat-enabled users.
General mitigation guidance
Effective mitigation focuses on enforcing authorization at the messaging and event-dispatch layers and minimizing data exposure by default.
Common defensive patterns include:
- Scoping MessageBus channels by permission and feature flags so only authorized, chat-enabled subscribers can receive chat events.
- Performing explicit authorization checks at publish time to ensure that sensitive payloads are only sent to access-controlled topics.
- Reducing the sensitivity of data broadcast on shared channels, favoring minimal metadata or identifiers instead of full message payloads.
- Segregating internal event streams for different capabilities (e.g., chat vs. non-chat) and avoiding reuse of generic channels for sensitive content.
- Applying least-privilege principles to integration points, limiting what each subscriber can subscribe to based on its functional role.
How teams detect issues like this
Detection can rely on both code-level analysis and operational monitoring:
- Review event publishing code to confirm that all MessageBus topics carrying user-generated content are protected by explicit authorization and feature checks.
- Use static analysis or custom linters to flag direct publication of sensitive payloads to generic or shared channels without permission filters.
- Inspect configuration and plugin code for broad or wildcard MessageBus subscriptions that consume more topics than necessary.
- Monitor logs or telemetry from MessageBus subscribers to detect unexpected receipt of chat-related events by components that do not implement chat functionality.
- Periodically audit data flows for sensitive user content, ensuring real-time messaging infrastructure does not bypass normal access control layers.

