Skip to content

[4.0] build(security): run the Java services without the JVM Base64 intrinsics - #26603

Merged
antobinary merged 1 commit into
bigbluebutton:v4.0.x-releasefrom
antobinary:fix-400-jvm-disable-base64-intrinsics
Nov 18, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v4.0.x-releasefrom
antobinary:fix-400-jvm-disable-base64-intrinsics

Conversation

@antobinary

Copy link
Copy Markdown
Member

What does this PR do?

Sets JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics in the systemd units of bbb-web, bbb-apps-akka and bbb-fsesl-akka, one line each:

Environment="JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics"
  • build/packages-template/bbb-web/bbb-web.service
  • akka-bbb-apps/src/templates/systemloader/systemd/start-template
  • akka-bbb-fsesl/src/templates/systemloader/systemd/start-template

As with MALLOC_ARENA_MAX in 9d4dc4b, the setting goes into the units these packages ship rather than into drop-ins from bbb-config. An operator drop-in or the EnvironmentFile entries (/etc/default/bbb-web, /etc/bigbluebutton/bbb-web.env, /etc/default/bbb-apps-akka, /etc/default/bbb-fsesl-akka) can still override it.

Closes Issue(s)

Refs #26599

Motivation

This is a workaround for CVE-2026-114938 ("Java4Shell"), published on 2026-11-17: an out-of-bounds write in the HotSpot Base64 decoding intrinsic on x86-64. It affects OpenJDK 17.0.6 and later on CPUs with AVX-512 VBMI (Intel Xeon from Ice Lake on, AMD from Zen 4 on), which covers many current servers and cloud instances. ARM64 is not affected.

BigBlueButton 4.0 runs bbb-web, bbb-apps-akka and bbb-fsesl-akka on Ubuntu's openjdk-21 (24.04). The newest package there, 21.0.13.0.3 (2026-11-09), predates the fix, and as of 2026-11-18 Ubuntu lists openjdk-21 as vulnerable on 22.04 and 24.04 with no fixed version. On an affected CPU all three services run with the intrinsic enabled (UseBASE64Intrinsics = true {default}). We have not ruled out a path for untrusted input to reach the decoder, so we treat them as exposed until a fixed JDK is installed.

-XX:-UseBASE64Intrinsics is one of the two JVM-level workarounds in the announcement. It makes java.util.Base64 run its plain Java implementation instead of the intrinsic, which removes the affected code. We prefer it to the other workaround, -XX:UseAVX=2, because it turns off only the Base64 intrinsics rather than every AVX-512 code path. These services decode very little Base64, so there is no measurable cost, and the flag is harmless on CPUs without AVX-512.

None of the three units sets JAVA_TOOL_OPTIONS today. The JVM logs Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics once at startup. The services pick the setting up on their next restart. Once Ubuntu ships a fixed openjdk-21 and servers have it, the line can be removed. Until then this PR does not close #26599.

How to test

  1. Install bbb-web, bbb-apps-akka and bbb-fsesl-akka built from this branch, then run sudo bbb-conf --restart.
  2. The units carry the variable:
    systemctl show -p Environment bbb-web bbb-apps-akka bbb-fsesl-akka | grep -o 'JAVA_TOOL_OPTIONS=[^ ]*'
    Expected: JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics three times.
  3. Each running JVM has the intrinsic off:
    for p in $(pgrep -u bigbluebutton -x java); do sudo -u bigbluebutton jcmd $p VM.flags -all | grep -w UseBASE64Intrinsics; done
    Expected: UseBASE64Intrinsics = false {product} {environment} three times. Without this PR it reads true {product} {default}.

Checked so far on a 4.0 development container (Ubuntu 24.04, systemd 255, openjdk-21 21.0.12.1, x86-64):

Check Result
systemd-analyze verify on the three modified units PASS for all three
A throwaway unit with the same Environment= line, running java -XX:+PrintFlagsFinal -version Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics, UseBASE64Intrinsics = false {environment}
The same unit plus an operator drop-in 10-java.conf setting JAVA_TOOL_OPTIONS The operator's value wins
For comparison: the value shipped as a drop-in named jvm-base64-intrinsics.conf next to that 10-java.conf The packaged value wins over the operator's
Step 3 against the running services, without this PR true {default} for all three

The packages were not built, and the real services were not restarted with the change.

Set JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics in the units of bbb-web,
bbb-apps-akka and bbb-fsesl-akka. As with MALLOC_ARENA_MAX in
9d4dc4b, the setting goes into the units these packages ship rather
than into drop-ins from bbb-config, so an operator drop-in or the
EnvironmentFile entries (/etc/default/bbb-web,
/etc/bigbluebutton/bbb-web.env, /etc/default/bbb-apps-akka,
/etc/default/bbb-fsesl-akka) can still override it.

With the flag, java.util.Base64 runs its plain Java implementation
instead of the CPU-specific intrinsic HotSpot enables by default on
recent x86-64 CPUs. These services decode very little Base64, so there
is no measurable cost. JAVA_TOOL_OPTIONS is not used by any of the
three units today, and the JVM logs "Picked up JAVA_TOOL_OPTIONS" once
at startup.

The services pick the setting up on their next restart.
@antobinary antobinary added this to the Release 4.0 milestone Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Three systemd service definitions now set JAVA_TOOL_OPTIONS to -XX:-UseBASE64Intrinsics. The change applies to the akka-bbb-apps and akka-bbb-fsesl service templates and the bbb-web service.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to 3436e

The change adds a JVM flag to three service units to disable the vulnerable Base64 intrinsic. Services use Java 21, which supports the flag, so startup should be unaffected. Operators who set their own JAVA_TOOL_OPTIONS in an environment file would replace the mitigation. No blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description matches the changeset. It names the three modified systemd units, gives the exact Environment line added to each, explains the motivation (a JVM Base64 intrinsic vulnerability workarou…
Linked Issues check Passed Issue #26599 (direct, open) asks for a patched Java runtime ("latest patched") for the CVE-2026-114938 exposure. The only coding-level requirement in the issue is to address that exposure in the BBB s…
Out of Scope Changes check Passed The diff touches only the three systemd unit templates. Each change is one Environment line that sets JAVA_TOOL_OPTIONS, matching the stated mitigation. The PR description states the same scope. The c…
Title check Passed The title names the main change: the Java services are run with the JVM Base64 intrinsics disabled. The raw summary confirms that the systemd units for bbb-web, the akka-bbb-apps service, and the akka…
Full details: Description check

Explanation

The description matches the changeset. It names the three modified systemd units, gives the exact Environment line added to each, explains the motivation (a JVM Base64 intrinsic vulnerability workaround), and describes how to test the change. It also states that the packages were not built and that the issue remains open.

Full details: Linked Issues check

Explanation

Issue #26599 (direct, open) asks for a patched Java runtime ("latest patched") for the CVE-2026-114938 exposure. The only coding-level requirement in the issue is to address that exposure in the BBB services. The reviewed head adds Environment="JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics" to build/packages-template/bbb-web/bbb-web.service, akka-bbb-apps/src/templates/systemloader/systemd/start-template, and akka-bbb-fsesl/src/templates/systemloader/systemd/start-template. This disables the affected Base64 intrinsic for all three JVMs, which is the mitigation named in the CVE announcement. Installing a fixed openjdk-21 package is non-coding and is outside this PR. The PR states it does not close #26599 and uses Refs #26599, which is consistent with the open issue. No automated test was added. The issue does not ask for one, and the PR's manual checks are non-coding.

Full details: Out of Scope Changes check

Explanation

The diff touches only the three systemd unit templates. Each change is one Environment line that sets JAVA_TOOL_OPTIONS, matching the stated mitigation. The PR description states the same scope. The change follows the existing MALLOC_ARENA_MAX pattern in the same units. No unrelated code, configuration, or documentation changes were found in the reviewed files.

Full details: Title check

Explanation

The title names the main change: the Java services are run with the JVM Base64 intrinsics disabled. The raw summary confirms that the systemd units for bbb-web, the akka-bbb-apps service, and the akka-bbb-fsesl service now set JAVA_TOOL_OPTIONS to -XX:-UseBASE64Intrinsics. The title is specific and matches the changeset and the stated objectives. The '[4.0]' prefix and 'build(security)' type are conventions, not a problem.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ae6bda9-e5a5-45c8-a271-5cb57f597970
Commits

Reviewing files that changed from the base of the PR and between f31e684 and 3436e8e.

Files selected for processing: 3

  • akka-bbb-apps/src/templates/systemloader/systemd/start-template
  • akka-bbb-fsesl/src/templates/systemloader/systemd/start-template
  • build/packages-template/bbb-web/bbb-web.service

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@paultrudel paultrudel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving.

What I checked:

  • The three files are what the packages install: build/packages-template/bbb-web/build.sh copies bbb-web.service, and the akka start-templates are the sbt-native-packager systemd templates. Nothing else sets JAVA_TOOL_OPTIONS at runtime.
  • On a 4.0 development server (Ubuntu 24.04, openjdk 21.0.12) I added the same Environment= line to the three services as a drop-in and restarted them:
    • All three started cleanly. jcmd VM.flags -all showed UseBASE64Intrinsics = false {product} {environment} for each, and the journal had the Picked up JAVA_TOOL_OPTIONS line.
    • The akka start scripts' java_version_check still reads the version correctly with that extra line in the java -version output.
    • A create with a base64 <document> in the body decoded to a byte-identical PDF, and ending the meeting went through akka as usual.
    • That CPU has no AVX-512 VBMI, so this shows the flag is applied and harmless, not the bug itself.

Non-blocking:

  • There is no PR for v4.0.x-develop yet, so develop builds (the nightlies included) won't carry the workaround until one lands.
  • An operator who sets JAVA_TOOL_OPTIONS in /etc/default/bbb-* or /etc/bigbluebutton/bbb-web.env replaces this value. A line in the release notes would cover it.

@antobinary antobinary changed the title build(security): run the Java services without the JVM Base64 intrinsics [4.0] build(security): run the Java services without the JVM Base64 intrinsics Nov 18, 2026
@antobinary
antobinary merged commit 02572fb into bigbluebutton:v4.0.x-release Nov 18, 2026
35 checks passed
germanocaumo pushed a commit to germanocaumo/bigbluebutton that referenced this pull request Nov 20, 2026
…x-develop

Brings the 4.0.3 release back into v4.0.x-develop. v4.0.x-release is at
f72d451, which is the v4.0.3 tag; the merge base is 28d54de, the
v4.0.x-develop commit that bigbluebutton#26324 took into the release for 4.0.2.

Commits that come in:

- build: run the Java services without the JVM Base64 intrinsics
  (bigbluebutton#26603)
- build(freeswitch): v1.11.4 (up from v1.11.3) (bigbluebutton#26625)
- chore: Update BigBlueButton release version to 4.0.3
- fix(recording): archive only this session's learning dashboard data
- fix(bbb-web): keep learning dashboard data until the recording is
  archived
- fix: validate learning dashboard locale
- fix: bound GraphQL query variables
- fix(bbb-web): improve caption track handling
- fix: improve presentation file handling
- chore: maintenance patch for the 4.0 release line (two commits)
- enforce breakoutRoomsRecord value, which changes nothing here:
  v4.0.x-develop already has the same change
- build(bbb-webrtc-recorder): v0.18.1 and "a manual nudge": not taken,
  see below

The bbb-build image tag in .gitlab-ci.yml moves to the release's,
v4.0.x-release--2026-11-19-140801.

Conflicts:

- bbb-webrtc-recorder.placeholder.sh: the release went from v0.18.0 to
  v0.18.1 and then added a blank line to trigger a rebuild, while
  develop went to v0.19.1 (b3cc87b). Kept develop's file as it is:
  v0.19.1 is the newer line and carries the same three recorder fixes
  as v0.18.1.
- bbb-common-message RedisStorageService.java, imports only. Develop
  added ArrayList and List for readResqueJobs (bigbluebutton#26562); the release
  replaced HashMap with SecureRandom for the caption tokens. Kept
  SecureRandom, ArrayList and List, and dropped HashMap: its only user
  was the caption-token code the release rewrote. Both method bodies
  merged without conflict.
antobinary pushed a commit that referenced this pull request Nov 20, 2026
…er 1 (#26642)

Since 4.0.3 was merged into v4.0.x-develop (#26631), check-copies.sh has
warned on every api-conformance run: three of the package files Tier 1
mirrors by hand had changed.

- bbb-web.service and bbb-apps-akka's unit set
  JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics (#26603). Both images'
  start scripts now set it too. bbb-web's keeps a JAVA_TOOL_OPTIONS that
  compose.yaml passes in, such as a coverage agent, after the flag.
- akka-apps' start script also sets MALLOC_ARENA_MAX=2, which its unit
  has set since 9d4dc4b. Tier 1 had followed that only for bbb-web.
- bbb-web's after-install.sh writes a random pageTokenSecret. Tier 1
  already sets a known one in tier1.properties.in (#26634); the
  Dockerfile's note on what after-install.sh does now names it.

copies.sha256 records the three sources as they are now.
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.

2 participants