Skip to content

fix: lockSettingsHideUserList leaks usernames in the chat if a viewer was (temp) set to presenter - #25000

Merged
antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:issue-24984
May 4, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:issue-24984

Conversation

@ramonlsouza

Copy link
Copy Markdown
Member

What does this PR do?

  • do not send presenter change chat message if lockSettingsHideUserList is active and a user mentioned in the message is a viewer
  • do not send "user is away/back" messages if lockSettingsHideUserList is active and user is a viewer

Closes Issue(s)

Closes #24984

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b64071bb-d676-4344-a22b-ea21a5155b94

📥 Commits

Reviewing files that changed from the base of the PR and between 263f27e and 1794a4d.

📒 Files selected for processing (1)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala

Walkthrough

The changes add permission checks that suppress system chat messages revealing viewer identities when the meeting is configured with hide-user-list. Presenter-assignment announcements and away-status system messages are now skipped if permissions.hideUserList is true and the affected user has role VIEWER. Imports were added to access Roles and MeetingStatus2x for these checks.

Sequence Diagram(s)

sequenceDiagram
actor Moderator
participant AssignPresenterReqMsgHdlr as "AssignPresenterReqMsgHdlr"
participant MeetingStatus as "MeetingStatus2x.getPermissions"
participant ChatDAO as "ChatMessageDAO"
participant Broadcast as "BroadcastService"

Moderator->>AssignPresenterReqMsgHdlr: request assign presenter
AssignPresenterReqMsgHdlr->>MeetingStatus: getPermissions(meeting.status)
MeetingStatus-->>AssignPresenterReqMsgHdlr: permissions (hideUserList)
AssignPresenterReqMsgHdlr-->>AssignPresenterReqMsgHdlr: evaluate newPres.role == VIEWER & hideUserList
alt not (hideUserList & viewer)
    AssignPresenterReqMsgHdlr->>ChatDAO: insertSystemMsg("USER_IS_PRESENTER_MSG")
    ChatDAO-->>Broadcast: message persisted
    Broadcast-->>Moderator: notify clients
else suppressed
    AssignPresenterReqMsgHdlr-->>Broadcast: skip system message, continue other updates
    Broadcast-->>Moderator: notify clients (no presenter system chat)
end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing username leaks in chat when lockSettingsHideUserList is enabled and viewers are set as presenters.
Description check ✅ Passed The description is directly related to the changeset, outlining the two main objectives: suppressing presenter-change and away-status messages when lockSettingsHideUserList is active and users are viewers.
Linked Issues check ✅ Passed All code changes implement the requirements from issue #24984: suppressing chat messages for presenter changes and away-status updates when lockSettingsHideUserList is enabled and the user is a viewer.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the lockSettingsHideUserList username leakage issue; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala (1)

129-139: ⚡ Quick win

Add regression tests for both viewer-in-message branches.

Please add focused coverage for:

  1. hideUserList=true + newPres is viewer, and
  2. hideUserList=true + assignedBy is viewer.
    This path is privacy-sensitive and worth pinning with tests.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala`
around lines 129 - 139, Add two focused regression tests for
AssignPresenterReqMsgHdlr behavior when hideUserList is true: one where newPres
has role Roles.VIEWER_ROLE and one where assignedBy user has role
Roles.VIEWER_ROLE; each test should construct a liveMeeting with
MeetingStatus2x.getPermissions(...).hideUserList = true, set up Users2x entries
so assignedBy and newPres have the appropriate roles, invoke the handler (or the
method that computes shouldSkip) and assert that ChatMessageDAO.insertSystemMsg
is NOT called (or that no USER_IS_PRESENTER_MSG is persisted) for both branches,
and include a complementary positive test where a non-viewer assignment does
emit the message to ensure correctness.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala`:
- Around line 129-139: Add two focused regression tests for
AssignPresenterReqMsgHdlr behavior when hideUserList is true: one where newPres
has role Roles.VIEWER_ROLE and one where assignedBy user has role
Roles.VIEWER_ROLE; each test should construct a liveMeeting with
MeetingStatus2x.getPermissions(...).hideUserList = true, set up Users2x entries
so assignedBy and newPres have the appropriate roles, invoke the handler (or the
method that computes shouldSkip) and assert that ChatMessageDAO.insertSystemMsg
is NOT called (or that no USER_IS_PRESENTER_MSG is persisted) for both branches,
and include a complementary positive test where a non-viewer assignment does
emit the message to ensure correctness.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e7940050-0769-440f-8ef2-35815dd1d99c

📥 Commits

Reviewing files that changed from the base of the PR and between c95fa23 and 263f27e.

📒 Files selected for processing (3)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserAwayReqMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala

@antobinary antobinary added this to the Release 3.0 milestone Apr 30, 2026
@antobinary

Copy link
Copy Markdown
Member

Hi @ramonlsouza

I find we've had to add a bunch more logic for lockSettingsHideUserList to the point where it acts like lockSettingsIsolateUsers (or similar). Do you think we should create this additional parameter (or rename the ...HideUserList one)?

@ramonlsouza

Copy link
Copy Markdown
Member Author

Hi @ramonlsouza

I find we've had to add a bunch more logic for lockSettingsHideUserList to the point where it acts like lockSettingsIsolateUsers (or similar). Do you think we should create this additional parameter (or rename the ...HideUserList one)?

Yes, it makes sense to rename it to something that makes it clear that not only the user list is affected

val assignedByName = assignedByUser.map(_.name).getOrElse("")

val hideUserList = MeetingStatus2x.getPermissions(liveMeeting.status).hideUserList
val assignedByIsViewer = assignedByUser.exists(_.role == Roles.VIEWER_ROLE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only moderators can assign presenter.
So I think you can revert this validation and validate only the assigned user role.

@ramonlsouza
ramonlsouza requested a review from gustavotrott May 4, 2026 13:59
@sonarqubecloud

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@antobinary
antobinary merged commit 9fd5e4d into bigbluebutton:v3.0.x-develop May 4, 2026
78 of 84 checks passed
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

🚨 Automated tests failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lockSettingsHideUserList leaks usernames in the chat if a viewer was (temp) set to presenter

3 participants