# CVE-2026-114938 | Oracle Java SE and OpenJDK Base64 Decoder Heap Buffer Overflow Vulnerability (Java4Shell)

AVX-512 Base64 decode intrinsic in HotSpot miscalculates output length on padded tails, writing 62-63 bytes past the heap array for potential takeover.

- Payout: Research
- Severity: high
- Program: Oracle
- Write-up by: Horizon3
- Disclosed: 2026-11-18
- CVE: CVE-2026-114938
- Write-up quality: 6/10
- Original: https://horizon3.ai/attack-research/vulnerabilities/cve-2026-114938/
- Library page: https://bugbountylibrary.com/r/blog%3Ahorizon3-ai-attack-research-vulnerabilities-cve-2026-114938
- Tags: area:oss domain:oss impact:integrity impact:rce kind:research platform:research sev:high tech:java technique:source-review vuln:memory-corruption

**Target:** HotSpot x86-64 AVX-512 Base64 decode intrinsic (java.util.Base64)
**Root cause:** Handling the final partial block, the routine derives an output length from the block size and subtracts one byte per trailing = padding character, so a tail of one to three bytes yields a negative length. The store mask built from that value is read as a full-width mask.
**Steps:**
1. Reach an application that Base64-decodes attacker-supplied data via java.util.Base64 basic or URL decoder on an AVX-512-capable x86-64 CPU.
2. Get the decode method JIT-compiled so HotSpot substitutes the AVX-512 Base64 decode intrinsic.
3. Supply Base64 input whose final partial block ends in one to three `=` padding characters, producing a negative derived output length.
4. The full-width store mask causes the routine to write 62 or 63 bytes past the destination array, corrupting the following heap object.
**Exploitation:** Unauthenticated attacker supplies crafted Base64 data to any service decoding untrusted input; the intrinsic overflows the heap array by 62-63 bytes, corrupting the adjacent object. Oracle describes the outcome as takeover of the affected product; no public PoC chain detailed.
**Insight:** JIT intrinsics that replace library loops are a separate attack surface from the Java class library: audit assembly fast paths for edge cases (partial blocks, padding) where scalar reference code is correct but the vectorized mask arithmetic underflows.

## Write-ups of the same bug (oldest first)
- 2026-11-17: [Java4Shell: Write once, RCE everywhere](https://bugbountylibrary.com/r/blog%3Acalif-io-java4shell) — @calif_io
- 2026-11-18: [Aikido's Deep Review finds Java4Shell in the PR that introduced it](https://bugbountylibrary.com/r/blog%3Aaikido-dev-blog-deep-review-finds-java4shell-in-pr) — Aikido Security
- 2026-11-18: [CVE-2026-114938 | Oracle Java SE and OpenJDK Base64 Decoder Heap Buffer Overflow Vulnerability (Java4Shell)](https://bugbountylibrary.com/r/blog%3Ahorizon3-ai-attack-research-vulnerabilities-cve-2026-114938) — Horizon3 (this one)

