Skip to content

fix(presentation): Require SessionToken and PageToken on Presentation Page Requests - #25020

Merged
antobinary merged 22 commits into
bigbluebutton:v3.0.x-developfrom
paultrudel:pres-page-idor-client-revised
May 11, 2026
Merged

antobinary merged 22 commits into
bigbluebutton:v3.0.x-developfrom
paultrudel:pres-page-idor-client-revised

Conversation

@paultrudel

@paultrudel paultrudel commented May 6, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds session token authentication to Nginx and PresentationController presentation file requests to prevent users that are not part of the meeting that a presentation belongs to from accessing presentation files.

Adds a new optional pageTokenSecret parameter to bigbluebutton.properties that defaults to the same value as the securitySalt. Setting this parameter will cause an HMAC signature to be generated for each presentation page and enables an additional layer of security on requests for presentation page files. When enabled, all requests for presentation page files will be required to supply the signature corresponding to the requested presentation page. The signatures are generated from the presentation ID, page number, and presTokenSecret. Signatures are stored as part of the presentation URI in Postgres and are therefore accessible to the client through GraphQL mutations.

Introduces a new disabled feature, slidePreloading, that, when disabled, prevents users from being able to access slides that have not been revealed.

Closes Issue(s)

Closes #11919

@coderabbitai

coderabbitai Bot commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds HMAC-based per-page tokens for presentation resources and integrates token generation, propagation, and verification across conversion, messaging, backend, nginx, and clients. Page tokens are produced during presentation conversion and included in Page/Slide models and generated URLs. Frontend wraps resource URLs with an authentication helper that appends sessionToken and pageToken. Nginx performs an auth_request to an internal controller endpoint which validates the session and verifies the page token before allowing access. Configuration and bean wiring for a pageTokenSecret are added, and controllers, services, and clients updated to enforce token and session checks.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Nginx
  participant CheckAuth
  participant PresentationController
  participant Storage
  Client->>Nginx: GET /presentation/slide.svg?sessionToken=...&pageToken=...
  Nginx->>CheckAuth: auth_request (X-Original-URI)
  CheckAuth->>PresentationController: checkPresentationAuthorization
  PresentationController->>PresentationController: validateSession and verify HMAC token
  PresentationController-->>CheckAuth: 200 or 401 or 403
  Nginx->>Storage: proxy_pass resource if 200
  Storage-->>Client: resource bytes
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: requiring session token and page token authentication for presentation page requests to prevent unauthorized access.
Description check ✅ Passed The description accurately explains the PR's purpose, implementation details (session tokens, page token secrets, HMAC signatures), and how it addresses the security issue of preventing unauthorized slide access.
Linked Issues check ✅ Passed The PR successfully addresses issue #11919 by implementing session-token authentication, HMAC-based page tokens, and a slidePreloading feature flag to prevent users from accessing unrevealed slides and enumerating sequential slide indices.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objectives: adding session/page token authentication, implementing HMAC signatures, adding pageTokenSecret configuration, and introducing the slidePreloading feature flag. Minor formatting changes in SQL and build scripts are incidental.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

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

Copilot AI 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.

Pull request overview

This PR hardens access to presentation assets by requiring a valid sessionToken for slide/page/download requests, and optionally enforcing a per-page HMAC (pageToken) to prevent guessing adjacent slide URLs. It also introduces a disabled feature (slidePreloading) that forces preloadNextSlides=0 so clients don’t receive “next slide” URLs/tokens until a slide is revealed.

Changes:

  • Add Nginx auth_request gating for presentation slide assets and downloads, backed by a new PresentationController.checkPresentationAuthorization endpoint.
  • Generate and validate per-page HMAC tokens (pageToken) and propagate them through server messages and clients.
  • Add a slidePreloading disabled feature that disables client-side next-slide prefetching.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
bigbluebutton-web/nginx-confs/presentation-slides.nginx Adds auth_request to protect svg/pdf/thumbnail/textfiles slide asset routes served by Nginx.
bigbluebutton-web/grails-app/services/org/bigbluebutton/web/services/PresentationService.groovy Adds pageTokenSecret injection point used to decide whether to enforce per-page tokens.
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/UrlMappings.groovy Exposes /bigbluebutton/presentation/checkAuthorization for Nginx auth_request.
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy Implements authorization check endpoint + enforces session/page token checks on fallback presentation endpoints.
bigbluebutton-web/grails-app/conf/spring/resources.xml Wires pageTokenSecret into bbbWebApiGWApp and presentationService.
bigbluebutton-web/grails-app/conf/bigbluebutton.properties Introduces pageTokenSecret config and injects into presentationService.
bigbluebutton-web/bbb-web.nginx Protects download route with auth_request and adds internal /presentation/checkAuthorization proxy location.
bigbluebutton-html5/imports/ui/services/features/index.js Formatting-only change (newline).
bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx Authenticates the whiteboard background SVG URL by appending sessionToken.
bigbluebutton-html5/imports/ui/components/presentation/container.jsx Authenticates slide SVG URLs and download URIs; ensures preloaded slide fetches include sessionToken.
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx Authenticates presentation download link URLs shown in chat.
bbb-learning-dashboard/src/components/StatusTable.jsx Adds sessionToken + pageToken to slide/thumbnail URLs for protected access from the dashboard.
bbb-learning-dashboard/src/App.js Passes sessionToken down to StatusTable (but currently introduces a modal state variable bug).
bbb-graphql-server/bbb_schema.sql Formatting cleanup for update_preloadNextPages() trigger function.
bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala Generates per-page HMAC token, appends pageToken to slide URLs, and includes pageToken in page VOs.
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala Threads pageTokenSecret into MsgBuilder calls when publishing presentation conversion events.
bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala Extends PageVO / PresentationPageConvertedVO to carry pageToken.
akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala Persists pageToken alongside slide timeline entries for dashboard slide links.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala Implements slidePreloading disabled feature by forcing preloadNextSlides=0 in client settings.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala Adds pageToken to the internal PresentationPage model.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala Propagates pageToken when building outgoing presentation/page VOs.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPageConvertedSysMsgHdlr.scala Stores pageToken in meeting state when a page conversion event is handled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bbb-learning-dashboard/src/App.js Resolved

@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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
bbb-learning-dashboard/src/components/StatusTable.jsx (1)

223-247: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid emitting unauthenticated presentation URLs when tokens are missing.

On Line 226, tokenParams becomes '' when either token is absent, so Lines 239/246 still render raw presentation URLs. With token enforcement enabled, this causes failed thumbnail/link requests (notably when sessionToken is empty in report-token flows). Gate rendering on both tokens (or render a non-clickable placeholder) instead of generating unauthenticated URLs.

Suggested fix
                 const {
                   presentationId, pageNum, pageToken, presentationName,
                 } = slide || {};
-                const tokenParams = pageToken && sessionToken
+                const hasAuthTokens = Boolean(pageToken && sessionToken);
+                const tokenParams = hasAuthTokens
                   ? `?${new URLSearchParams({ pageToken, sessionToken })}`
                   : '';
                 return (
                   <td
@@
-                    { slide && (
+                    { slide && hasAuthTokens && (
                       <div className="flex">
                         <div className="my-4">
                           <a
                             href={`${URLPrefix}/${presentationId}/svg/${pageNum}${tokenParams}`}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bbb-learning-dashboard/src/components/StatusTable.jsx` around lines 223 -
247, The current rendering builds unauthenticated URLs when tokenParams is
empty; update the render logic in StatusTable.jsx (the cell that uses slide,
tokenParams, URLPrefix, sessionToken) to require both pageToken and sessionToken
before emitting link/img anchors: if either token is missing, do not construct
clickable href/src—either render a non-clickable placeholder or a disabled
thumbnail element with appropriate aria text. Locate the JSX that constructs
tokenParams and the anchor/img blocks and gate those elements on (pageToken &&
sessionToken) instead of inserting an empty tokenParams string.
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)

199-218: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align cache keys for preloaded slides to fix inconsistent deduplication logic.

The code checks against a numeric key at line 200 (fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE]) but only writes with a URL key at line 212 (fetchedSlide[slide.svgUrl]). The numeric key is never set, so the outer gate will always pass and re-enter the block on each render. The inner filter at line 207 prevents duplicate fetches, masking the issue, but the inconsistent keys indicate confused caching logic.

Either set the numeric key when caching:

presentation.fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE] = true;

Or use a single stable identifier throughout (e.g., a consistent slide ID rather than mixing numeric indices with authenticated URLs).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bigbluebutton-html5/imports/ui/components/presentation/container.jsx` around
lines 199 - 218, The prefetch logic mixes numeric keys and URL keys for caching
(check uses fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE] while writes use
fetchedSlide[slide.svgUrl]), so align them: either set the numeric index key
when you mark a slide fetched (presentation.fetchedSlide[currentSlide.num +
PRELOAD_NEXT_SLIDE] = true) or, preferably, normalize to a single stable
identifier (use the authenticated URL key everywhere) by changing the outer
existence check to use the same Auth.authenticateURL(url)/slide.svgUrl lookup;
update the references to PRELOAD_NEXT_SLIDE, currentSlide.num, fetchedSlide and
slide.svgUrl so the check and the write use the identical key and remove the
inconsistent mixed-key logic.
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy (2)

548-560: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

thumbnail is still authorized by session only.

Unlike showThumbnail/showSvgImage/showPng/showTextfile, this action never checks the meeting or a page token before reading from confDir(). Any valid session token can therefore authorize a guessed thumbnail path from another meeting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`
around lines 548 - 560, The thumbnail action currently only calls
validateSession() and then reads files from confDir() using
params.id/params.thumb, allowing any valid session to access other meetings'
thumbnails; update thumbnail to enforce the same meeting/page-token checks as
the other endpoints (e.g. the logic used by
showThumbnail/showSvgImage/showPng/showTextfile) before calling
presentationService.showThumbnail(presDir, params.thumb): derive the meetingId
(or use params.meetingId/pageToken) and verify it against userSession (or call
the existing authorization helper used by those other actions) to reject
requests that are not authorized for that meeting or valid page token. Ensure
the check happens prior to building presDir or reading pres.readBytes().

567-587: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

These XML listing endpoints still publish untokenized slide paths.

The payloads only expose sequential slide/N, thumbnail/N, textfiles/N, and svgs/N names, but the corresponding file handlers now reject requests without pageToken. Any client still consuming these responses will start getting 403s when page-token enforcement is enabled.

Also applies to: 596-615, 624-643, 652-671

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`
around lines 567 - 587, The XML responses in numberOfSlides are emitting
untokenized resource paths (slide/N, thumbnail/N, textfile/N, svgs/N) which will
be rejected by handlers requiring pageToken; to fix, generate and embed a page
token for each slide when building the XML: inside numberOfSlides (and the
similar endpoints at 596-615, 624-643, 652-671) call a presentationService
helper to get a token for each index (e.g.,
presentationService.getPageToken(conf, rm, presentationName, i) or equivalent)
and append it to the slide, thumb, textfile and svg URLs (for example as a query
param or tokenized path) so each slide element includes the required pageToken
before rendering.
🧹 Nitpick comments (1)
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (1)

29-30: ⚡ Quick win

Consider warning when pageTokenSecret is blank.

pageTokenSecret: String = "" keeps the constructor optional, which is fine for tests / partial wiring. However, downstream the controller's check is if (presentationService.pageTokenSecret) (falsy on empty string in Groovy), so an explicitly-blank pageTokenSecret silently disables per-page token verification and downgrades the new protection to session-only. The default in bigbluebutton.properties covers this, but a startup log.warn (here or in PresentationService) when the value is empty would make accidental misconfiguration visible instead of failing open.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala`
around lines 29 - 30, The constructor default pageTokenSecret = "" can silently
disable per-page token checks because the controller uses if
(presentationService.pageTokenSecret) (falsy for an empty string); add a startup
warning when the secret is blank to surface misconfiguration: detect empty
pageTokenSecret in the BbbWebApiGWApp initialization (or inside
PresentationService constructor/init) and emit a log.warn describing that
pageTokenSecret is empty and per-page token verification is disabled,
referencing the pageTokenSecret field and PresentationService so reviewers can
locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bigbluebutton-html5/imports/ui/services/features/index.js`:
- Around line 160-162: Guard the access to the emoji picker config so missing
keys don't throw: change the EMOJI_PICKER_ENABLED assignment to safely read
window.meetingClientSettings.public.chat.emojiPicker.enable with optional
chaining or a safe getter and default to false (e.g. const EMOJI_PICKER_ENABLED
= window.meetingClientSettings?.public?.chat?.emojiPicker?.enable ?? false),
then keep the existing return that checks
useDisabledFeatures().indexOf('chatEmojiPicker') === -1 && EMOJI_PICKER_ENABLED;
this ensures emojiPicker is false when the config is absent.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`:
- Around line 378-381: Reject non-numeric page identifiers before recomputing
the HMAC: in PresentationController (the code paths that compute expected =
generatePageToken(... Integer.parseInt(...), ...)) validate that params.slide /
params.thumb / params.png / params.textfile are numeric first (e.g. regex match
or Integer.tryParse pattern) and return a 403 (or 400) immediately if not
numeric, rather than calling Integer.parseInt which throws
NumberFormatException; apply the same guard to showThumbnail, showPng, and
showTextfile so malformed values never reach generatePageToken.

---

Outside diff comments:
In `@bbb-learning-dashboard/src/components/StatusTable.jsx`:
- Around line 223-247: The current rendering builds unauthenticated URLs when
tokenParams is empty; update the render logic in StatusTable.jsx (the cell that
uses slide, tokenParams, URLPrefix, sessionToken) to require both pageToken and
sessionToken before emitting link/img anchors: if either token is missing, do
not construct clickable href/src—either render a non-clickable placeholder or a
disabled thumbnail element with appropriate aria text. Locate the JSX that
constructs tokenParams and the anchor/img blocks and gate those elements on
(pageToken && sessionToken) instead of inserting an empty tokenParams string.

In `@bigbluebutton-html5/imports/ui/components/presentation/container.jsx`:
- Around line 199-218: The prefetch logic mixes numeric keys and URL keys for
caching (check uses fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE] while
writes use fetchedSlide[slide.svgUrl]), so align them: either set the numeric
index key when you mark a slide fetched
(presentation.fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE] = true) or,
preferably, normalize to a single stable identifier (use the authenticated URL
key everywhere) by changing the outer existence check to use the same
Auth.authenticateURL(url)/slide.svgUrl lookup; update the references to
PRELOAD_NEXT_SLIDE, currentSlide.num, fetchedSlide and slide.svgUrl so the check
and the write use the identical key and remove the inconsistent mixed-key logic.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`:
- Around line 548-560: The thumbnail action currently only calls
validateSession() and then reads files from confDir() using
params.id/params.thumb, allowing any valid session to access other meetings'
thumbnails; update thumbnail to enforce the same meeting/page-token checks as
the other endpoints (e.g. the logic used by
showThumbnail/showSvgImage/showPng/showTextfile) before calling
presentationService.showThumbnail(presDir, params.thumb): derive the meetingId
(or use params.meetingId/pageToken) and verify it against userSession (or call
the existing authorization helper used by those other actions) to reject
requests that are not authorized for that meeting or valid page token. Ensure
the check happens prior to building presDir or reading pres.readBytes().
- Around line 567-587: The XML responses in numberOfSlides are emitting
untokenized resource paths (slide/N, thumbnail/N, textfile/N, svgs/N) which will
be rejected by handlers requiring pageToken; to fix, generate and embed a page
token for each slide when building the XML: inside numberOfSlides (and the
similar endpoints at 596-615, 624-643, 652-671) call a presentationService
helper to get a token for each index (e.g.,
presentationService.getPageToken(conf, rm, presentationName, i) or equivalent)
and append it to the slide, thumb, textfile and svg URLs (for example as a query
param or tokenized path) so each slide element includes the required pageToken
before rendering.

---

Nitpick comments:
In `@bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala`:
- Around line 29-30: The constructor default pageTokenSecret = "" can silently
disable per-page token checks because the controller uses if
(presentationService.pageTokenSecret) (falsy for an empty string); add a startup
warning when the secret is blank to surface misconfiguration: detect empty
pageTokenSecret in the BbbWebApiGWApp initialization (or inside
PresentationService constructor/init) and emit a log.warn describing that
pageTokenSecret is empty and per-page token verification is disabled,
referencing the pageTokenSecret field and PresentationService so reviewers can
locate the change.
🪄 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: 6a46ccd8-e804-4c8c-bb7e-16e258ba52c6

📥 Commits

Reviewing files that changed from the base of the PR and between d16d1a9 and 62474e1.

📒 Files selected for processing (22)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPageConvertedSysMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala
  • bbb-graphql-server/bbb_schema.sql
  • bbb-learning-dashboard/src/App.js
  • bbb-learning-dashboard/src/components/StatusTable.jsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx
  • bigbluebutton-html5/imports/ui/components/presentation/container.jsx
  • bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx
  • bigbluebutton-html5/imports/ui/services/features/index.js
  • bigbluebutton-web/bbb-web.nginx
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties
  • bigbluebutton-web/grails-app/conf/spring/resources.xml
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/UrlMappings.groovy
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy
  • bigbluebutton-web/grails-app/services/org/bigbluebutton/web/services/PresentationService.groovy
  • bigbluebutton-web/nginx-confs/presentation-slides.nginx

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy (1)

60-149: ⚖️ Poor tradeoff

Consider letting nginx cache successful auth_request responses.

Cache-Control: no-cache is set unconditionally (lines 65, 76, even on the 200 authorized paths). Combined with auth_request in presentation-slides.nginx, every SVG/thumbnail/textfile/PDF byte range fetched by every viewer will round-trip through this controller and re-execute session lookups + HMAC computation. For a slide deck with hundreds of pages and dozens of viewers this is a meaningful hot path.

Since the (sessionToken, presId, page) triple is stable for the lifetime of a session, you can let nginx cache auth_request responses for a short TTL by emitting cache hints on the 200 branches and configuring auth_request_cache (or proxy_cache in front of the auth location) on the nginx side. The 401/403 branches should keep no-cache to avoid sticky denials.

If you'd rather not change behavior in this PR, this can be deferred — flagging as operational advice rather than blocking.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`
around lines 60 - 149, The controller unconditionally sets "Cache-Control:
no-cache" which prevents nginx from caching successful auth_request responses;
update checkPresentationAuthorization so it does not add the no-cache header
globally—remove or move the response.addHeader("Cache-Control", "no-cache") call
and instead add cache hints only on successful 200 branches (the blocks that set
response.setStatus(200) and write 'authorized') e.g. set a short TTL like
response.addHeader("Cache-Control", "public, max-age=60") there, while keeping
the existing no-cache behavior on the 401/403 error branches; make changes
inside the checkPresentationAuthorization method and adjust all three 200 paths
(slideMatcher, downloadMatcher, pdfMatcher) where response.setStatus(200) is
used.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`:
- Line 66: The response content type is incorrectly set to 'plain/text' in
PresentationController (in the checkPresentationAuthorization endpoint and two
other spots); replace every occurrence of response.contentType = 'plain/text'
with response.contentType = 'text/plain' to use the correct MIME type (search
for the string 'plain/text' in PresentationController and update in the
checkPresentationAuthorization method and the other instances referenced).

---

Nitpick comments:
In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`:
- Around line 60-149: The controller unconditionally sets "Cache-Control:
no-cache" which prevents nginx from caching successful auth_request responses;
update checkPresentationAuthorization so it does not add the no-cache header
globally—remove or move the response.addHeader("Cache-Control", "no-cache") call
and instead add cache hints only on successful 200 branches (the blocks that set
response.setStatus(200) and write 'authorized') e.g. set a short TTL like
response.addHeader("Cache-Control", "public, max-age=60") there, while keeping
the existing no-cache behavior on the 401/403 error branches; make changes
inside the checkPresentationAuthorization method and adjust all three 200 paths
(slideMatcher, downloadMatcher, pdfMatcher) where response.setStatus(200) is
used.
🪄 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: cede18e1-cfc8-4b88-8245-ceee05d0e5e9

📥 Commits

Reviewing files that changed from the base of the PR and between 62474e1 and ff2f327.

📒 Files selected for processing (1)
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build/packages-template/bbb-config/after-install.sh`:
- Line 80: The sed substitution for SECRET uses a greedy s/.*=// which strips
trailing base64 '=' padding; change it to remove only the key prefix (e.g. use
s/^[^=]*=// or use cut -d'=' -f2- on the securitySalt line) so SECRET correctly
captures the full base64 value from bigbluebutton.properties (securitySalt) and
prevents sharedSecret in application.conf from being set to an empty string.
🪄 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: 866d4ae3-89d9-4672-82dc-1435b9c5c37d

📥 Commits

Reviewing files that changed from the base of the PR and between 44fefbc and c606bce.

📒 Files selected for processing (1)
  • build/packages-template/bbb-config/after-install.sh

gustavotrott and others added 3 commits May 7, 2026 22:49
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented May 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@gustavotrott gustavotrott 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.

LGTM!

@antobinary
antobinary merged commit abf61a1 into bigbluebutton:v3.0.x-develop May 11, 2026
35 checks passed
antobinary pushed a commit that referenced this pull request Jun 10, 2026
…#25241)

Presentation resource URLs are built with only a pageToken. Since #25020
the server also requires a sessionToken in the query string and returns
401 before checking anything else. The slide path already appends it via
Auth.authenticateURL, but the media-sharing presentation thumbnail used
the raw URL straight from GraphQL, so its request was rejected with 401
and the thumbnail never loaded.

Authenticate the thumbnail URL with the same helper (idempotent, does not
duplicate an existing token). Adds a Playwright test that opens the manage
presentations panel and asserts the thumbnail carries the session token
and actually loads (naturalWidth > 0).

Fixes #25163

Co-authored-by: Claudio Promptoso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent users from accessing next/previous slides in a presentation.

4 participants