Newshot

Someone reported java4shell bug in September 2026

Original text(via Hacker News)
题图
题图

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.

  • I confirm that I make this contribution in accordance with the OpenJDK Interim AI Policy.

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

Checkout this PR locally: $ git fetch https://git.openjdk.org/jdk.git pull/32781/head:pull/32781 $ git checkout pull/32781

Update a local copy of the PR: $ git checkout pull/32781 $ git pull https://git.openjdk.org/jdk.git pull/32781/head

Checkout this PR locally: $ git pr checkout 32781

View PR using the GUI difftool: $ git pr show -t 32781

Download this PR as a diff file: https://git.openjdk.org/jdk/pull/32781.diff

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Hacker News
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗