Repository navigation
fix(docker): move the image to Ruby 3.4.13 (CVE-2026-132825) - #34
Merged
Merged
Conversation
The image ran Debian 11's Ruby 2.7.4 (python:3.10.8 + ruby-full), which is EOL and affected by Ruby2Shell (CVE-2026-132825). Use ruby:3.4.13-bookworm instead, with Python 3.11 from Debian in a venv for Ansible (ansible-core 2.15.6 supports Python up to 3.11, so not the default trixie tag). Ruby 3 fixes needed by the new interpreter: - File.exists? / Dir.exists? -> exist? (removed in Ruby 3.2) - open(url) -> URI(url).open in the provider and packager. open-uri no longer patches Kernel#open since Ruby 3.0, and URI(...).open (not URI.open) cannot fall back to Kernel#open, which would run a "|cmd" argument as a shell command (CodeQL rb/non-constant-kernel-open). - Gemfile: pin base64, mutex_m and racc to the versions Ruby 3.4.13 ships (no longer default gems; needed by aws-sdk-core, minitest and parser) - One unit test asserted on Ruby 2.7's NoMethodError message text; assert on the missing method instead. CI now runs the tests on Ruby 3.4.13 as well.
Nandu-pns
force-pushed
the
fix/ruby-3.4-base-image
branch
from
November 20, 2026 15:23
fdb21ff to
72cffaa
Compare
Collaborator
Author
|
FYI for reviewers: the 3 failing cloud UAT checks ( |
pranav-new-relic
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The image ran Ruby 2.7.4, from Debian 11's
ruby-fullon top ofpython:3.10.8. Ruby 2.7 is EOL and affected by Ruby2Shell (CVE-2026-132825); the fixed releases are 3.3.14, 3.4.13 and 4.0.10. Updating gems doesn't help here. The interpreter in the image has to change.This image (
newrelic/deployer:latest) runs every E2E test in open-install-library (PR checks, daily regression, smoke and cleanup), so the goal is to change the interpreter without changing behavior.Changes
python:3.10.8→ruby:3.4.13-bookworm. Debian's own Ruby can't be used: bookworm ships 3.1.2 (EOL) and trixie 3.3.13, both below the fix. Python 3.11 now comes from Debian, in a venv (/opt/venv, onPATH), because Debian 12 blocks system-wide pip installs. Bookworm rather than the default trixie tag, because the pinnedansible-core==2.15.6supports Python up to 3.11.File.exists?/Dir.exists?→exist?, removed in Ruby 3.2 (provisioner.rb,terminator.rb,installer.rb, the UAT spoofers)open(url)→URI(url).openincommand_line/provider.rbandinstall/packager.rb. open-uri stopped patchingKernel#openin Ruby 3.0.URI(...).open(rather thanURI.open) can't fall back toKernel#open, which would run a|cmdargument as a shell command (CodeQLrb/non-constant-kernel-open). Both paths only gethttp(s)URLs, which is why CI on Ruby 3.0.5 didn't catch them.base64 0.2.0,mutex_m 0.3.0andracc 1.8.1, the versions Ruby 3.4.13 ships. They're no longer default gems in 3.4, andaws-sdk-core,minitestandparserneed them under Bundler.Gemfile.lockonly gains these three; no other version changes, and it's stillBUNDLED WITH 2.5.6.tests/deployment/aws/type_validator_factory_tests.rb) asserted on Ruby 2.7'sNoMethodErrortext, which used to include the receiver. It now asserts on the missing method.test.yml) runs on Ruby 3.4.13 instead of 3.0.5.Unchanged: Terraform 0.11.11, ansible-core 2.15.6, the Ansible collections and roles, the pip requirements, and the
main.rb/batch.rbentry points and flags.Testing
Image checks (built for
linux/amd64, aspublish.ymldoes):ruby 3.4.13,Python 3.11.2(/opt/venv),ansible-core 2.15.6,Terraform 0.11.11,Bundler 2.5.6, Debian 12amazon.aws 5.1.0,community.aws 5.0.0,azure.azcollection 1.18.1,google.cloud 1.0.2,newrelic.*)hosts: localhostplaybook (like the provision templates) runs with/opt/venv/bin/python3and importsboto3rake test:unit: 848 runs, 1338 assertions, 0 failures, 0 errors, the same as the current image (Ruby 2.7.4)main.rbandbatch.rbload and print their optionsURI(url).openreturns the same content forhttpsURLs and rejects a|cmdargument, whereURI.openwould run itEnd-to-end (open-install-library PR 1478, draft, not for merge): builds the image from this branch at
72cffaa(ruby 3.4.13) and runs three open-install-library tests that also passed in the same day's regression on the current image.infra-agent/ubuntu24-infra.jsonlogging/amazonlinux2023.json-n logs-integration)ohi/linux/rabbitmq-debian.jsonEach one runs provision → install → validation → teardown. All Ansible plays exit 0, with no errors.
publish.ymlis manual, so merging doesn't changenewrelic/deployer:latest. It gets republished separately, followed by an open-install-library E2E run.