Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 5 min read

Your dependency scanner cannot see Java4Shell. I built a 3-condition check that can.

Your dependency scanner cannot see Java4Shell. I built a 3-condition check that can. On 17 November 2026, researcher Quang Luong (Calif) disclosed Java4Shell (CVE-2026-114938): a heap out-of-bounds write in the HotSpot

Your dependency scanner cannot see Java4Shell. I built a 3-condition check that can.

Your dependency scanner cannot see Java4Shell. I built a 3-condition check that can.

On 17 November 2026, researcher Quang Luong (Calif) disclosed Java4Shell (CVE-2026-114938): a heap out-of-bounds write in the HotSpot AVX-512 Base64 decoder. A 65-byte crafted Base64 input makes the decoder write 62 bytes past its heap output buffer. Calif demonstrated pre-auth RCE on default configs of Keycloak, Jira, Confluence, JFrog Artifactory, Jenkins and PingFederate in the lab. CVSS 4.0 is 9.2 Critical (Calif); CVSS 3.1 is 8.1 High (Oracle). Fixed builds shipped the same day: 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 and 8u513-perf. As of 18 November 2026 there are no reports of exploitation in the wild and the CVE is not in the CISA KEV catalog. Calif published a safe trigger-only reproducer; no weaponised public exploit exists, and the per-product exploits are withheld.

Here is the part that should worry every team running Java in production: the flaw is in the runtime, not in any library. A dependency scan of pom.xml or an SBOM finds nothing. And a version-only CVE match calls a host "vulnerable" even when its CPU has no AVX-512 VBMI at all. Exposure needs all three conditions together, on the host the JVM actually runs on:

  1. An affected patch level (OpenJDK 17.0.6 and later, lines 21, 25, 27).
  2. An x86-64 CPU with all four flags: avx512f, avx512bw, avx512vbmi, bmi2.
  3. The Base64 fast path switched on (the default, unless -XX:-UseBASE64Intrinsics).

I built java4shell to answer one question per install: do all three line up here? It is a zero-dependency TypeScript CLI (Node 20+). Everything runs locally; no network, no CVE database, no exploit code, and it never runs the crashing input against a live JVM.

java4shell demo

What it does

java4shell scan [--dirs <dir>...] [--cpuinfo <file>] [--jvm-flags <file>] [--scan-code <dir>] [--json]
java4shell check <jdk-dir> [--cpuinfo <file>] [--jvm-flags <file>] [--json]
java4shell decode-scan <dir> [--json]
java4shell playbook
java4shell explain <topic>
java4shell init
  • scan discovers JDK installs (from PATH, /usr/lib/jvm, --dirs, or a fleet list) and verdicts each one: EXPOSED, AT-RISK, SAFE or UNKNOWN, with the deciding condition printed per install.
  • check verdicts one JDK in detail: version, patch range, CPU flags and their source file, intrinsics state and its source.
  • decode-scan finds Base64 decode sites in your code or inside jar bytes, so you can judge whether untrusted input reaches the decoder at all. A decode site is REVIEW only, never proof of exploitability.
  • playbook prints the first-hour response plan for this CVE: patch order, the -XX:-UseBASE64Intrinsics mitigation, and what to verify after.
  • explain prints the CVE facts, the verdict rules and the sources, with the date they were checked (18 November 2026).
  • init writes a java4shell.config.json for CI use.

Exit codes: 0 = SAFE (or ALLOW in check), 1 = EXPOSED / AT-RISK / REVIEW found, 2 = usage error or nothing to audit. check and scan are built to be CI gates: fail the build while any install in the fleet is EXPOSED.

Install from source only - the java4shell package is not published to npm yet (the name is unclaimed; npm returned 404 when checked on 18 November 2026):

git clone https://github.com/techdevfun/java4shell.git
cd java4shell
npm install
npm run build
npm link   # or run ./dist/cli.js directly

Example output (real CLI output from the demo transcript, demo/transcript.txt; the fleet is synthetic, the version strings are recorded from real Temurin JREs run during the build):

$ java4shell scan --dirs temurin-17-vuln oracle-17-fixed temurin-11-safe --cpuinfo cpuinfo-vbmi.txt
jdk home                                     version      cpu vbmi  intrinsics verdict
----------------------------------------------------------------------------------------------------
/tmp/java4shell-demo/fleet/temurin-17-vuln   17.0.21      all 4     on         EXPOSED
  patch: affected range (17.0.21 < 17.0.21.1)
  deciding: version + CPU + intrinsics all line up
/tmp/java4shell-demo/fleet/oracle-17-fixed   17.0.21.1    all 4     on         SAFE
  patch: fixed build (17.0.21.1 >= 17.0.21.1)
/tmp/java4shell-demo/fleet/temurin-11-safe   11.0.33      all 4     on         SAFE
  patch: not affected (Java 11 has no AVX-512 Base64 intrinsic)

summary: EXPOSED 1 | AT-RISK 0 | SAFE 2 | UNKNOWN 0 | installs 3
exit: 1

The wedge works as designed on real JDKs, not just fixtures. During the build I downloaded and ran real Temurin JREs (17.0.21+9 and 11.0.33+10). On the build host (AMD EPYC, no AVX-512), the vulnerable 17.0.21+9 JRE verdicts SAFE by CPU - a version-only scanner would have flagged it. The same JRE with a VBMI cpuinfo fixture verdicts EXPOSED. That is the whole point: version alone is the wrong question.

How it compares

Tool What it checks Live CPU flags? Intrinsics state? Fleet scan + CI gate?
Trivy / Grype Version match against a CVE database No No Yes, for dependencies
Semgrep detection rules (free, 18/11/2026) 5 conditions: HotSpot VM, x86-64 JVM, x86-64 host, version >= 17.0.6, no patch No (host arch only) No No, detection rules only
Gist shell runtime checker Single-host version + CPU check Partial No No
java4shell Patch level + CPU flags + intrinsics, per install Yes, from cpuinfo Yes, from JVM flags / env Yes, exit codes + --json

Sonatype puts the gap plainly: "the flaw is in the runtime, not a third-party library, so project dependency scans will not identify every affected installation." JFrog agrees: inventory runtime versions and do not stop at system-installed Java. java4shell is the standalone, zero-dependency CLI that does the runtime check those scanners skip.

Where rivals beat us, honestly: Trivy and Grype cover thousands of CVEs across every dependency you ship; java4shell checks exactly one CVE and says so on every output. Semgrep's rules run inside a mature static-analysis platform with IDE and CI integrations java4shell does not have. If you need broad CVE coverage, use a scanner. If you need to know whether this JDK on this host is actually exposed to Java4Shell, use this tool.

Honest limits

  • Only CVE-2026-114938 is checked. A SAFE verdict means these three conditions do not line up, not that the host is safe from every Java flaw.
  • Fixed-build numbers use Oracle's November 2026 CPU as the reference. Other vendors ship the fix under different build numbers; an unplaceable version verdicts UNKNOWN, never SAFE.
  • CPU flags must be read on the host the JVM runs on. In a container, pass the host cpuinfo with --cpuinfo; the source path is printed in every output.
  • The Oracle fixed-build fixture is labelled REPRESENTATIVE FORMAT: no Oracle JDK was downloaded during the build. The Temurin fixtures are recorded from real JREs.
  • decode-scan finds decode sites; it does not prove untrusted input reaches them. That judgement is yours.
  • The demo transcript prints the build machine's absolute path for the cpuinfo fixture in two lines. Cosmetic only; the check itself takes a relative path fine.
  • An EXPOSED verdict is runtime exposure, not proof of exploitability. Your app may never decode untrusted Base64. The tool never claims otherwise.

The code is on GitHub: techdevfun/java4shell. If you run Java 17+ on x86-64, run java4shell scan and see whether the three conditions line up on your hosts before the patch window closes.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.