Ruby2Shell and Java4Shell: rebuild your images, even if the app is the same

Most scanners tell you if a library in your app is old. They do not look at the runtime your app runs on. Two November flaws live exactly there: Ruby2Shell in Ruby, and Java4Shell in OpenJDK. An app can keep the same version number while the Ruby or Java inside its container image is out of date.

The fix is often "pull a new image or rebuild", not "update the app". This article shows how to see which runtime each container carries, and what to do about it.

7

memory bugs fixed in Ruby on 18 Nov

4

Java lines affected: 17, 21, 25, 27

9.2

Java4Shell score from its finders (CVSS 4.0)

0

fixes for Ruby 3.2 and older

The short version#

TRUE

Ruby fixed seven memory bugs on 18 November

Ruby 4.0.10, 3.4.13 and 3.3.14. The Ruby team says it knows of working proof-of-concept code for some of them.

TRUE

Ruby 3.2 and older get no fix

They are end-of-life. The only fix is to move to a newer Ruby.

TRUE

Java4Shell needs a certain kind of CPU

It only works on x86-64 processors with AVX-512 VBMI. ARM64 CPUs (Raspberry Pi, Apple Silicon) are not affected, according to its finders.

UNKNOWN

Attacks in the wild

We found no confirmed attacks for either flaw. CISA's SSVC rating for Java4Shell, recorded in NVD on 17 November, was "exploitation: none".

UNKNOWN

Your app is affected

Depends on the Ruby or Java inside it and on how it is used. That is why you have to check each container.

What happened#

Ruby2Shell#

On 18 November 2026 the Ruby team released Ruby 4.0.10, 3.4.13 and 3.3.14. They fix seven bugs in two areas: the regular expression engine (the code behind pattern matching) and string case conversion (turning text into upper or lower case).

The headline bug, nicknamed Ruby2Shell (advisory ID GHSA-34m4-m9fh-gqp5), is a one-byte heap buffer overflow: when a crafted string changes case, one byte is written outside its memory buffer. NVD's entry for CVE-2026-132825 says it can happen for legacy single-byte encodings such as ISO-8859-1 or Windows-1252.

Science cornerWhat is a heap buffer overflow?

A program stores data in boxes of memory. An overflow means writing more data than the box holds, so the extra bytes damage the box next door. Attackers try to steer that damage so the program runs their code instead of its own. Even one wrong byte can be enough. This is called remote code execution (RCE) when it works over a network.

Who can reach it? Two sources (elest.io and getastra) say Rails and "classic-style" Sinatra reach the bug in their default setup, and that other frameworks and plain Rack are not exposed by default. We could not confirm this in a primary source. Treat it as "assume yes if you run Rails".

The scores disagree: NVD's CVE-2026-132825 (still marked "Received") carries a 7.4 "High" score from MITRE that describes a local attack, while the Ruby advisory talks about remote code execution. Do not wait for the scores to settle.

Java4Shell#

On 17 November 2026 OpenJDK and Oracle released fixes for CVE-2026-114938, nicknamed Java4Shell. It is a memory-corruption bug in how HotSpot (the engine of the Java virtual machine) decodes Base64 - a common way to write binary data as text, used in logins, uploads and messages. The researchers at Calif found that a Base64 string of just 65 characters can write past the end of a memory area.

CISA's alert of the same day describes it as a flaw in "the Base64 decoder of the x86-64 HotSpot Java Virtual Machine" and says specially crafted input "could crash the JVM and allow for unauthenticated remote code execution."

The finders say there is no universal exploit: each application needs its own steps. They showed working attacks on Keycloak, Jira, Jenkins and others in default settings. Oracle's score is 8.1 (CVSS 3.1); Calif gives 9.2 (CVSS 4.0).

  • Official
  • Record
  • Other

Official

Java4Shell fixes and CISA alert

OpenJDK and Oracle ship fixes. CISA tells organisations to find every JDK, including those inside container images.

Official

Ruby security release

Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven bugs. Ruby 3.2 and older are not fixed.

Record

Ruby2Shell gets a CVE ID

NVD lists CVE-2026-132825 for the one-byte overflow. Render publishes a "rebuild and redeploy" advisory.

Other

elest.io tells self-hosters to check images

Its weekly digest says the app version did not change but the runtime under it did.

Why your scanner may say "all clear"#

A dependency scanner reads your app's list of libraries (for Ruby: gems; for Java: jar files). The Ruby interpreter or the Java virtual machine is not on that list. It comes from the base image your container starts from.

Science cornerWhat is a base image?

A container image is built in layers. The bottom layer is usually a ready-made image such as ruby:3.4 or an eclipse-temurin Java image. It already contains the runtime. The app is added on top. If you do not rebuild, you keep the runtime from the day the image was built.

CISA says the same about Java: runtimes "may not appear as separate entries in software inventories", including those inside container images and appliances.

Am I affected?#

SoftwareAffectedFixed in
Ruby 4.04.0.0 to 4.0.94.0.10
Ruby 3.43.4.0 to 3.4.123.4.13
Ruby 3.33.3.13 and earlier3.3.14
Ruby 3.2 and olderall (end-of-life)no fix - upgrade Ruby
OpenJDK 17, 21, 25, 27 (and builds made from them: Temurin, Corretto, Zulu, Liberica, Microsoft, Red Hat, Oracle) on x86-64 with AVX-512 VBMI17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, 27.0.1.0.3 and earlier (17.0.6 or newer, according to Calif)the November builds; Debian's fixes are 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1
OpenJDK on ARM64not affected (Calif)-
Java 8 and 11not listed by elest.io; see note-

A note on Java 8: elest.io says lines 8 and 11 are not affected, but NVD's Oracle entry lists one Oracle Java SE 8 build (8u511b33-perf). We could not settle this, so check your vendor's advisory if you run Java 8.

For Ruby, official Docker images were updated: the Docker library file we checked on 4 December lists the tags 4.0.10, 3.4.13 and 3.3.14. We did not verify other vendors' images - check the build date of yours.

What to do now#

  1. List your containers and the images they use. Names are dummy examples:

    Run in terminalbash
    docker ps --format "table {{.Names}}\t{{.Image}}"
    

    Expected: one row per container.

  2. Ask each container which Ruby or Java it carries. Replace my-app with your own container name (dummy value):

    Run in terminalbash
    docker exec my-app ruby -v
    docker exec my-app java -version
    

    Expected for a fixed Ruby: ruby 3.4.13 ... (or 4.0.10 or 3.3.14 or higher on that line). Expected for Java: a line like openjdk version "21.0.13.1" ... (dummy example). "executable file not found" just means that runtime is not in this container.

    For a stopped container or an image, run the check without starting the app:

    Run in terminalbash
    docker run --rm --entrypoint ruby my-registry.example/my-app:1.0 -v
    
  3. Check whether your CPU can even be hit by Java4Shell. Only x86-64 CPUs with AVX-512 VBMI are affected. On Linux, run this on the host (it is the finders' command); all four flags must appear:

    Run in terminalbash
    grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
    

    Expected on an affected CPU: four lines (avx512f, avx512bw, avx512vbmi, bmi2). Nothing printed means the vulnerable code path does not run there. Calif names Intel Ice Lake and newer Xeons and AMD Zen 4 or newer as examples. A Raspberry Pi is ARM64 and is not affected.

  4. Pull or rebuild the images, then recreate the containers. In the folder with your docker-compose.yml (same on Linux, Windows and Mac):

    Run in terminalbash
    docker compose pull
    docker compose build --pull
    docker compose up -d
    

    Run step 2 again. You should see the fixed version. If your own Dockerfile pins an old tag such as FROM ruby:3.3.13, change it to a fixed tag (for example ruby:3.3.14) first - the FROM line decides the runtime.

  5. Update runtimes installed directly on your computer. Pick your system.

Linux#

Run in terminalbash
ruby -v
java -version
sudo apt update && sudo apt upgrade

Distro packages keep their own version numbers and add fixes to them, so an old-looking Ruby may still be patched. Look up CVE-2026-132825 and CVE-2026-114938 on your distro's security tracker. Debian, for example, lists fixed OpenJDK packages.

Windows#

Run in terminalpowershell
ruby -v
java -version
winget upgrade EclipseAdoptium.Temurin.21.JDK

The winget line is an example for Eclipse Temurin 21. Use the package for your own Java build. For Ruby, install a fixed version from rubyinstaller.org.

Mac#

Run in terminalbash
ruby -v
java -version
brew upgrade ruby
brew upgrade openjdk@21

Use the Homebrew package that matches your Java line. Apple Silicon Macs are ARM64, so Java4Shell does not hit them, but update anyway.

  1. If you cannot update Java yet: the finders list a stop-gap. Start the JVM with -XX:-UseBASE64Intrinsics (turns off the faster Base64 code). In a container, set it for the whole container with the JAVA_TOOL_OPTIONS setting:

    File contentyaml
    environment:
      JAVA_TOOL_OPTIONS: "-XX:-UseBASE64Intrinsics"
    

    This is a stop-gap, not a fix. The Ruby advisory lists no workaround for its bugs - upgrade.

Common mistakes#

MistakeWhy it happensDo this instead
"The app version did not change, so nothing changed."The runtime sits under the app, in the base image.Run ruby -v or java -version inside the container.
docker compose pull but no up -dThe old container keeps running.Recreate the container and check again.
Trusting the scanner's all-clearScanners read libraries, not the interpreter or JVM.Also check the runtime version by hand or with an image scanner that looks at the OS and runtimes.
Staying on Ruby 3.2It is end-of-life and gets no fix.Move to 3.3.14, 3.4.13 or 4.0.10 or newer.
Asking an AI assistant "what is the fixed Java version?" and copying the answerAssistants may quote an older release number, or one for a different distribution.Read your vendor's advisory and compare the version java -version prints.

Our take#

The two bugs differ: the Ruby one touches many web apps, while the Java one needs a specific CPU and a specific use of Base64. The lesson is the same: an app update and a runtime update are two separate jobs. After every big advisory, list your containers, check each runtime, and rebuild.

We found no confirmed attacks yet, but the Ruby team says it knows of proof-of-concept code for some of its bugs, and Java4Shell's finders have shown working attacks on well-known Java products. That is reason enough to act this week.

Sources#

Checked on 4 December 2026. Primary sources first.

  1. Security advisories: multiple vulnerabilities in Regexp and String case conversion - Ruby, 18-19 Nov 2026
  2. Ruby 3.3.14 released - Ruby, 18 Nov 2026
  3. CVE-2026-132825 on NVD - NIST, published 19 Nov 2026
  4. OpenJDK Vulnerability Advisory 2026/11/17 - OpenJDK, 17 Nov 2026
  5. CVE-2026-114938 on NVD - NIST, published 17 Nov 2026, updated 1 Dec 2026
  6. Critical Java Vulnerability Requires Immediate Patching - CISA, 17 Nov 2026
  7. Java4Shell: Write once, RCE everywhere - Calif, 17 Nov 2026 (updated 19 Nov)
  8. Debian security tracker for CVE-2026-114938 - Debian, checked 4 Dec 2026
  9. Advisory: Ruby2Shell and Associated Vulnerabilities - Render, 19 Nov 2026
  10. Ruby2shell: Critical Ruby Heap Overflow, Who Is Affected, and How to Fix It - Astra Security
  11. Self-Hosted Weekly: Week 48, 2026 - elest.io, 27 Nov 2026
  12. Docker official Ruby image tags - Docker Library, checked 4 Dec 2026

Try one of these