Summary
A privilege management flaw in Discourse's signup flow allows new users to set their primary_group_id and inherit whisper-group capabilities without actually belonging to those groups.
On instances where whispers_allowed_groups is configured, this can expose private whisper content and grant elevated messaging privileges to unauthorized accounts.
Affected context
This vulnerability affects Discourse deployments that:
- Enable user registration through the standard signup flow, and
- Use the
whispers_allowed_groupsconfiguration to restrict whisper visibility and posting.
The issue manifests when the signup logic allows a newly created account to influence or set its primary_group_id in a way that is not backed by legitimate group membership checks, effectively bypassing the intended access control boundary around whisper-enabled groups.
Exploit preconditions
- Attack surface: Public or semi-public Discourse instances exposing the signup endpoint.
- Required access: Ability to create a new user account (standard registration, possibly including email confirmation if enforced).
- Trigger point: Completion of the signup flow where user attributes such as
primary_group_idare accepted or derived. - Why exploitation is possible: The server-side logic responsible for assigning
primary_group_iddoes not fully enforce that the selected or resulting group is one the user is legitimately a member of, allowing a crafted signup path to associate the account with a whisper-enabled group.
Why this happens
The root cause is an Improper Privilege Management pattern mapped to CWE-269, where authorization decisions are tied to a mutable attribute (primary_group_id) that is not strictly constrained by membership verification.
Instead of deriving group-based privileges from authoritative membership records, the implementation allows the effective privilege-bearing group to be influenced during signup.
This breaks the expectation that whisper privileges are only granted after explicit and validated group assignments, turning the group identifier into a de facto capability token that can be misused by new users.
Potential impact
- Unauthorized viewing of whisper messages intended only for restricted groups.
- Posting or participating in whisper threads without legitimate group membership.
- Exposure of sensitive or semi-private discussions among moderators, staff, or private communities.
- Erosion of trust in the platform's private messaging and group isolation model.
General mitigation guidance
Effective mitigation focuses on tightening privilege derivation around groups and private messaging:
- Ensure that
primary_group_idand similar fields are always derived from verified group membership records, never from user-controllable input or loosely constrained parameters. - Centralize access control decisions for whispers so they depend on canonical membership checks rather than client-visible identifiers.
- Adopt a defense-in-depth model where private features (like whispers) require both group membership and explicit role or permission flags, reducing the impact of a single misbinding.
- Apply least-privilege defaults for new accounts, ensuring they start without any special group-based capabilities and require explicit administrative or policy-driven assignment.
- Regularly review access-control-related code paths (signup, SSO, invitations, and group assignment flows) for implicit trust in user attributes.
How teams detect issues like this
Detection typically involves both code-level and runtime analysis:
- Static analysis and code review: Look for places where privilege-bearing attributes such as
primary_group_idor group IDs are set during signup, SSO callbacks, or account updates without checking authoritative membership tables or permission services. - Policy enforcement checks: Introduce tests that assert only true group members can access whisper APIs or endpoints, and that new users never inherit whisper permissions by default.
- Runtime logging and analytics: Monitor for patterns of brand-new accounts gaining whisper access or accessing whisper endpoints; alert on anomalous spikes in whisper access from recently created users.
- Automated tooling: Use application security testing tools or custom linters that flag authorization decisions based solely on user-controlled or weakly validated profile fields.

