Repository navigation
Port BBB 3.0.24 to the upcoming BBB 3.0.25+ - #24906
Conversation
* Add auth check for caption updates * Verify user ID on caption submission * Ignore logoutURL param on checksum failure --------- Co-authored-by: Paul Trudel <[email protected]>
WalkthroughThis pull request introduces additional authorization and validation controls throughout the caption submission pipeline. Changes span multiple layers: client-side moderator checks in the GraphQL action, permission and caption-type validation in the Scala application handler, user state validation (listenOnly check) during transcript updates, and database-level conflict resolution tied to userId. The web layer adjusts logout URL handling for checksum-related join errors. Together, these changes restrict caption submission to authorized, non-listenOnly users and enforce caption-type allowlisting. Sequence Diagram(s)sequenceDiagram
participant Client as GraphQL Client
participant GraphQL as captionSubmitTranscript
participant ApiCtrl as ApiController
participant CaptionApp as CaptionApp2x
participant VoiceUsers as liveMeeting<br/>voiceUsers
participant CaptionDAO as CaptionDAO
participant DB as PostgreSQL
Client->>GraphQL: submitCaption(input)
GraphQL->>GraphQL: throwErrorIfNotModerator()
alt Moderator check fails
GraphQL-->>Client: Error
else Moderator check passes
GraphQL->>GraphQL: throwErrorIfInvalidInput()
alt Input invalid
GraphQL-->>Client: Error
else Input valid
GraphQL->>CaptionApp: CaptionSubmitTranscriptPubMsg
CaptionApp->>CaptionApp: permissionFailed(MOD_LEVEL, VIEWER_LEVEL)
alt Permission check fails
CaptionApp-->>Client: Error
else Permission check passes
CaptionApp->>CaptionApp: Validate captionType<br/>(allowlist: TYPED, AUDIO_TRANSCRIPTION)
alt Caption type invalid
CaptionApp->>CaptionApp: Log warning
CaptionApp-->>Client: Skip persistence & broadcast
else Caption type valid
CaptionApp->>VoiceUsers: Fetch user
alt User is listenOnly
CaptionApp-->>Client: Skip update
else User not listenOnly
CaptionApp->>CaptionDAO: insertOrUpdateCaption()
CaptionDAO->>DB: INSERT ... ON CONFLICT<br/>WHERE userId matches
DB-->>CaptionDAO: Upsert result
CaptionApp->>Client: broadcastSuccessEvent()
end
end
end
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/CaptionDAO.scala`:
- Around line 37-45: The upsert in CaptionDAO.scala silently no-ops when the
WHERE "caption"."userId" = ${userId} rejects a conflicting row; change the DAO
method performing this sqlu upsert to return the affected-row count or a boolean
(e.g., rowsAffected: Int or success: Boolean) and detect ownership mismatch
(rowsAffected == 0) and either return false or throw a specific
OwnershipMismatchException; then update the callers CaptionApp2x.handle and
UpdateTranscriptPubMsgHdlr.handle to check the DAO result and only broadcast
success when the write succeeded (or propagate the exception to fail-fast) so
clients don’t get false positives.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7a33706c-4e05-445c-884d-390b62459f70
📒 Files selected for processing (5)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/audiocaptions/UpdateTranscriptPubMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/caption/CaptionApp2x.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/CaptionDAO.scalabbb-graphql-actions/src/actions/captionSubmitTranscript.tsbigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy
| sqlu"""INSERT INTO "caption" ("captionId", "meetingId", "captionType", "userId", "locale", "captionText", "createdAt") | ||
| VALUES (${captionId}, ${meetingId}, ${captionType}, ${userId}, ${locale}, ${transcript}, ${now}) | ||
| ON CONFLICT ("captionId") | ||
| DO UPDATE SET | ||
| "captionText" = ${transcript}, | ||
| "locale" = ${locale}, | ||
| "captionType" = ${captionType}, | ||
| "createdAt" = ${now} | ||
| WHERE "caption"."userId" = ${userId}""" |
There was a problem hiding this comment.
Surface ownership conflicts back to callers.
When the WHERE "caption"."userId" = ${userId} clause rejects the conflicting row, this upsert becomes a silent no-op. The current callers in CaptionApp2x.handle and UpdateTranscriptPubMsgHdlr.handle still broadcast success immediately afterwards, so meeting state can diverge from the database and clients get a false positive. Please return the affected-row count/boolean here (or fail fast on ownership mismatch) so the success path can be gated on an actual write.
🤖 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/db/CaptionDAO.scala`
around lines 37 - 45, The upsert in CaptionDAO.scala silently no-ops when the
WHERE "caption"."userId" = ${userId} rejects a conflicting row; change the DAO
method performing this sqlu upsert to return the affected-row count or a boolean
(e.g., rowsAffected: Int or success: Boolean) and detect ownership mismatch
(rowsAffected == 0) and either return false or throw a specific
OwnershipMismatchException; then update the callers CaptionApp2x.handle and
UpdateTranscriptPubMsgHdlr.handle to check the DAO result and only broadcast
success when the write succeeded (or propagate the exception to fail-fast) so
clients don’t get false positives.
🚨 Automated tests failed |
5ab783e
into
bigbluebutton:v3.0.x-develop



https://github.com/bigbluebutton/bigbluebutton/releases/tag/v3.0.24