psf-java4shell-check(8)

Script: /opt/psf-security-patches/runtimes/java/java4shell-check.sh. Tool page: Java4Shell (OpenJDK). Script source. With the package installed: man psf-java4shell-check.

Overview

Java4Shell: OpenJDK Base64 decoder intrinsic out-of-bounds write, November 2026 (v1) CVE-2026-114938 (Oracle CVSS 3.1 8.1; public memory-corruption proof of concept)

On x86-64 processors with AVX-512 VBMI (Intel Ice Lake or newer, AMD Zen 4 or newer), the JIT's fast path for java.util.Base64 decoding can write past the end of its buffer when it decodes input an attacker chose. Tokens, authorization headers, SAML and uploads all go through Base64, and researchers showed it against Jira, Confluence, Artifactory and Jenkins. ARM servers and older x86 processors never take that path.

Affected: Java 17.0.6 and later, 21, 25 and 27 from any vendor without the November 2026 fix, and Oracle's Java 8 Performance Pack. Standard Java 8 and 11 are not affected. Fixed (Oracle): 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, 17 November 2026; Corretto, Temurin, Red Hat, Ubuntu and Debian builds followed, and a distribution package is judged by its changelog.

Command reference

The original help text below includes the command syntax, options, environment variables and exit codes supplied with this tool. Review the source and test any change before applying it to a production system.

Original command-line help
Java4Shell: OpenJDK Base64 decoder intrinsic out-of-bounds write, November 2026 (v1)
CVE-2026-114938 (Oracle CVSS 3.1 8.1; public memory-corruption proof of concept)

If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation
Help and documentation: https://privacysafe.app/docs/security-patches/runtimes/java/

On x86-64 processors with AVX-512 VBMI (Intel Ice Lake or newer, AMD Zen 4 or newer), the JIT's
fast path for java.util.Base64 decoding can write past the end of its buffer when it decodes
input an attacker chose. Tokens, authorization headers, SAML and uploads all go through Base64,
and researchers showed it against Jira, Confluence, Artifactory and Jenkins. ARM servers and
older x86 processors never take that path.

Affected: Java 17.0.6 and later, 21, 25 and 27 from any vendor without the November 2026 fix,
and Oracle's Java 8 Performance Pack. Standard Java 8 and 11 are not affected. Fixed (Oracle):
17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, 17 November 2026; Corretto, Temurin, Red Hat,
Ubuntu and Debian builds followed, and a distribution package is judged by its changelog.

Usage:
  ./java4shell-check.sh [command] [options]

  check (default)  Read-only. Reads this CPU's flags, then every Java runtime:
                   the ones under /usr/lib/jvm and ROOTS (including the copies
                   Jira, Confluence, Jenkins and others bundle), and the ones
                   running now, whose command line and environment also show
                   whether the workaround flag is in effect. A runtime is
                   judged by its release file and is never run; a
                   distribution package also by its changelog. Exit 0 = not
                   exposed, 1 = an affected runtime on a CPU with AVX-512 VBMI
                   (or a CPU whose flags could not be read), 2 = a runtime
                   could not be judged.
  mitigate [--dry-run] [--restart]   (root) For each running systemd service
                   whose Java is affected and does not already have it, adds
                   a drop-in that sets JAVA_TOOL_OPTIONS to the service's own
                   value plus "-XX:+IgnoreUnrecognizedVMOptions
                   -XX:-UseBASE64Intrinsics", which turns off only the
                   vulnerable fast path (the workaround AWS documents; not an
                   official Oracle one). It takes effect when the service
                   restarts: add --restart, or restart them yourself. Java
                   started some other way is listed with the flag to add.
  rollback [--dry-run] [--restart]   Removes those drop-ins.
  version          Prints the script version.

Env overrides:
  ROOTS="/usr/lib/jvm /opt /srv /usr/local /var/lib /home"   where check looks for runtimes
  MAX_DEPTH=7
  CPUINFO_FILE=/proc/cpuinfo
  DROPIN_ROOT=/etc/systemd/system
  STATE_DIR (default /var/lib/psf-security-patches/java4shell)
  PSF_LOCK_WAIT      seconds a run that changes the host waits for another (default 30)
  UNIT_FOR_PID       the service every Java process belongs to (testing only)

The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.