On this page (6 sections)

Ubuntu has published USN-9176-2, a security notice for Ruby on Ubuntu 16.04 LTS, 18.04 LTS and 20.04 LTS. It carries the fixes from the earlier USN-9176-1 to these releases, and the notice marks the updated packages as available with Ubuntu Pro.

If you run Ruby applications (Rails, Sinatra, Jekyll builds, deployment scripts) on one of these releases, check which Ruby package is installed and whether your machine can receive the fix. So far only one publisher, Ubuntu itself, covers this story, and the notice does not list CVE identifiers or CVSS scores.

What Ubuntu announced

USN-9176-1 fixed vulnerabilities in Ruby. USN-9176-2 is the follow-up that provides the corresponding updates for Ubuntu 16.04 LTS, 18.04 LTS and 20.04 LTS, covering the packages ruby2.3, ruby2.5 and ruby2.7. Ubuntu describes the notice simply as fixing several security issues in Ruby.

For all three releases, the notice marks the fixed packages as available with Ubuntu Pro. For 16.04 it says the fix comes through Ubuntu Pro via the Legacy Support add-on. Ubuntu states that Ubuntu Pro is free for up to five machines.

The weaknesses in plain terms

The notice lists seven issues, each tracked by a GitHub advisory identifier. All of them involve how Ruby handles text: converting the case of strings, compiling large regular expressions, converting regular expressions to strings, parsing regular expressions, and handling case-insensitive regular expressions. Ubuntu credits Stephan Lipp and Owais Lone for several items; two items are described only as "it was discovered" or are credited in the original advisory text.

Issues listed in USN-9176-2 and the impact Ubuntu describes
IdentifierArea (per Ubuntu)Possible impact (per Ubuntu)
GHSA-34m4-m9fh-gqp5Converting the case of certain stringsDenial of service or arbitrary code execution
GHSA-3p8q-wmhx-vm2wCompiling certain large regular expressionsDenial of service or arbitrary code execution
GHSA-7whj-cfh7-xgm4Converting certain regular expressions to stringsDenial of service or arbitrary code execution
GHSA-7x2q-68qv-6p8xMemory handling when parsing certain regular expressionsDenial of service or arbitrary code execution
GHSA-87fm-7w84-j2pxConverting the case of certain large stringsDenial of service or arbitrary code execution
GHSA-pvgc-g7gj-pv6hCertain case-insensitive regular expressionsDenial of service or obtaining sensitive information
GHSA-wpqw-5qxg-m68rCertain case-insensitive regular expressionsDenial of service or obtaining sensitive information
Ubuntu words the impact as what an attacker could possibly do. The notice does not say how likely exploitation is, whether any of these issues are being exploited, or what input an attacker must control. Treat those points as unconfirmed.

The practical risk depends on your application. Code that feeds untrusted input (form fields, API parameters, uploaded content) into case conversion or regular expression handling is the most likely to be exposed. Code that only processes trusted, fixed data is less likely to be reachable, though the notice does not quantify this.

Who is affected

  • Servers and containers built on Ubuntu 16.04, 18.04 or 20.04 that have ruby2.3, ruby2.5 or ruby2.7 (or the matching libruby and dev packages) installed.
  • Web applications and background workers written in Ruby that process user-supplied text.
  • Build and CI machines that run Ruby tooling on these releases.

Newer Ubuntu releases are not listed in this notice. If you are on one, check the Ubuntu security notices page for the original USN-9176-1 rather than assuming anything from this one.

How to check your exposure

Run this on the server to list installed Ruby packages and their versions. Compare the output against the fixed versions in the table below.

List installed Ruby packages and versions (Ubuntu 16.04, 18.04, 20.04)Shell
dpkg -l | grep -i ruby

Ruby installed outside the package manager (for example through a version manager or a language-specific installer) is not covered by this notice, so check those installs separately.

Fixed package versions from USN-9176-2
Ubuntu releasePackagesFixed version
20.04 LTS (focal)libruby2.7, ruby2.7, ruby2.7-dev2.7.0-5ubuntu1.18+esm6
18.04 LTS (bionic)libruby2.5, ruby2.5, ruby2.5-dev2.5.1-1ubuntu1.16+esm9
16.04 LTS (xenial)libruby2.3, ruby2.3, ruby2.3-dev, ruby2.3-tcltk2.3.1-2~ubuntu16.04.16+esm16

What to do now

  1. Run the dpkg command above on every Ubuntu 16.04, 18.04 and 20.04 host and note which Ruby packages are present.
  2. Confirm the host is attached to Ubuntu Pro (with the Legacy Support add-on for 16.04), since the notice marks the fixed versions as available that way.
  3. Apply a standard system update, which Ubuntu says will make the necessary changes.
  4. Restart Ruby services (application servers, workers) so running processes load the patched libraries.
  5. Re-run the version check and confirm the installed versions match or exceed the table.
  6. If you cannot patch yet, avoid passing untrusted input to Ruby code paths that convert case or build large regular expressions, and plan the update soon.

On a host that is attached to Ubuntu Pro, this refreshes package lists and upgrades installed packages, including Ruby. Afterwards, re-run the dpkg check and look for the fixed versions listed above.

Refresh package lists and apply updates (Ubuntu with Ubuntu Pro attached)Shell
sudo apt update && sudo apt upgrade
Caution. Restarting your Ruby application server or workers interrupts requests in progress. Do it in a maintenance window or behind a load balancer, and test the application after the update.
Tip. Older Ubuntu releases are easy to forget in server inventories. Keep a list of which hosts run which release and Ruby version, and plan upgrades to newer releases as well as applying these package updates.

Monitoring afterwards

Keep an eye on Ubuntu's security notices for further Ruby updates, and track which servers still run older Ubuntu releases. From the outside, Webforta Scan can show what your public site exposes, and Webforta Monitor can watch uptime, which helps you spot a service that fails to come back after a restart. Neither replaces patching the packages themselves.

For broader habits, see our guide to small business website security and browse more security news.

Sources

This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.

  1. USN-9176-2: Ruby vulnerabilities | Ubuntu security notices | Ubuntuubuntu.com ·
  • Ubuntu
  • Ruby
  • USN
  • Ubuntu Pro
  • Patch management