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.
| Identifier | Area (per Ubuntu) | Possible impact (per Ubuntu) |
|---|---|---|
| GHSA-34m4-m9fh-gqp5 | Converting the case of certain strings | Denial of service or arbitrary code execution |
| GHSA-3p8q-wmhx-vm2w | Compiling certain large regular expressions | Denial of service or arbitrary code execution |
| GHSA-7whj-cfh7-xgm4 | Converting certain regular expressions to strings | Denial of service or arbitrary code execution |
| GHSA-7x2q-68qv-6p8x | Memory handling when parsing certain regular expressions | Denial of service or arbitrary code execution |
| GHSA-87fm-7w84-j2px | Converting the case of certain large strings | Denial of service or arbitrary code execution |
| GHSA-pvgc-g7gj-pv6h | Certain case-insensitive regular expressions | Denial of service or obtaining sensitive information |
| GHSA-wpqw-5qxg-m68r | Certain case-insensitive regular expressions | Denial of service or obtaining sensitive information |
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.
dpkg -l | grep -i rubyRuby 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.
| Ubuntu release | Packages | Fixed version |
|---|---|---|
| 20.04 LTS (focal) | libruby2.7, ruby2.7, ruby2.7-dev | 2.7.0-5ubuntu1.18+esm6 |
| 18.04 LTS (bionic) | libruby2.5, ruby2.5, ruby2.5-dev | 2.5.1-1ubuntu1.16+esm9 |
| 16.04 LTS (xenial) | libruby2.3, ruby2.3, ruby2.3-dev, ruby2.3-tcltk | 2.3.1-2~ubuntu16.04.16+esm16 |
What to do now
- Run the dpkg command above on every Ubuntu 16.04, 18.04 and 20.04 host and note which Ruby packages are present.
- 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.
- Apply a standard system update, which Ubuntu says will make the necessary changes.
- Restart Ruby services (application servers, workers) so running processes load the patched libraries.
- Re-run the version check and confirm the installed versions match or exceed the table.
- 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.
sudo apt update && sudo apt upgradeMonitoring 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.
