Back Original

Someone reported java4shell bug in September 2026

In StubGenerator::generate_base64_decodeBlock() (x86_64 AVX-512 VBMI path), L_finalBit handles 1-63 leftover bytes with a masked vector sequence that computes output_size = (len/4)*3. Valid inputs always have a length multiple of 4, so this bug triggers only on invalid inputs: with length < 4 (e.g. "A".repeat(64)+"=" leaves 1 byte after L_process64Loop), output_size starts at 0 and the padding path decrements it below zero, producing a wrong output_mask. The stub stores past the logical output length before returning to Java, corrupting the heap.

The suggested fix is to early-return to Java if length < 4.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Integration blocker

 ⚠️ Failed to retrieve information on issue 8392044. Please make sure it exists and is accessible.

Issue

  • ⚠️ Failed to retrieve information on issue 8392044.

Reviewing

Using git

Checkout this PR locally:

Update a local copy of the PR:

Using Skara CLI tools

Checkout this PR locally:

View PR using the GUI difftool:

Using diff file

Download this PR as a diff file: