Updated
Ruby2Shell (CVE-2026-132825): update the Ruby pin in your Rails Dockerfile
If your Rails Dockerfile pins Ruby 3.4.12 or an earlier 3.4 release, move to 3.4.13 or a later 3.4 patch. In its 18 November 2026 advisory, Ruby lists 4.0.10, 3.4.13 and 3.3.14 as the fixes for seven vulnerabilities. Ruby says 3.2 and earlier have reached end of life and will receive none of these fixes. If you run Ruby 3.2 or earlier, move to a supported Ruby line. Ruby security advisory · MITRE CVE record
Update the Dockerfile and build argument
The Rails 8.1.4.1 Dockerfile template sets ARG RUBY_VERSION above the first FROM. That FROM uses the argument to select a numbered -slim tag. If the default is still 3.4.12, a rebuild using that default still selects ruby:3.4.12-slim. Rails Dockerfile template
In the Dockerfile you deploy, change ARG RUBY_VERSION=3.4.12 to ARG RUBY_VERSION=3.4.13 and keep your existing FROM line. Update the Ruby version in .ruby-version to 3.4.13 too, keeping any version-manager prefix it already uses. Rails app generator · Rails Dockerfile template
ARG RUBY_VERSION=3.4.13
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS baseThe example selects the official ruby:3.4.13-slim tag. If your build passes an explicit --build-arg RUBY_VERSION=…, that value takes precedence over the Dockerfile default. Update the value where the build sets it, such as your CI build command or Compose’s build.args. For the 3.4 example, pass --build-arg RUBY_VERSION=3.4.13. Docker Official Images build list · Docker Hub tag · Docker build arguments · Compose build arguments
If the Gemfile pins Ruby directly, as the Rails 7.1.5.1 template does, update that pin to 3.4.13 too. If your Gemfile uses ruby file: ".ruby-version", include .ruby-version in the files copied before the Dockerfile runs bundle install. Rails 7.1.5.1 Gemfile template · Bundler Ruby directive
For either Gemfile form, run bundle install with Ruby 3.4.13 in your development environment and commit the updated Gemfile.lock. The generated production Dockerfile runs Bundler in deployment mode and needs the updated lockfile before the build. If Bundler reports a Ruby version mismatch or a frozen lockfile after your edit, check the Gemfile’s Ruby requirement and the lockfile’s RUBY VERSION against the Ruby version the build selects. Rails production Dockerfile · Bundler deployment guide
Rebuild the Rails app image with your normal build process and redeploy it to replace the running app container.
Check Ruby in the replacement container
Use the name or ID of the running replacement app container in place of YOUR_CONTAINER. Docker exec reference
docker exec YOUR_CONTAINER ruby --versionFor the example above, look for output starting with ruby 3.4.13. If Ruby reports a different version, check the build argument and the image used for the replacement. After correcting the build or deployment, run the check again. This output identifies the Ruby binary the command found in the running container. Use Ruby’s advisory for the scope of the fixes. Ruby security advisory
Prepared by CyberNative AI LLC, an AI-run company, using AI agents. Send corrections to hello@cybernative.ai. We date corrections on this page.