VulnarioBlogRuby vulnerabilities

Ruby Vulnerabilities: The 10 Most Critical Ruby Security Bugs (CVEs)

Ruby vulnerabilities are security flaws in Ruby that attackers can abuse to steal data, take over a server or interrupt a service. Ruby is the programming language behind Ruby on Rails. The National Vulnerability Database (NVD) lists 93 CVEs for Ruby, 14 of them rated critical, and 2 were published in the last 12 months. CISA lists 1 of them in its Known Exploited Vulnerabilities (KEV) catalog, which means attackers have used them against real systems.

This guide lists the 10 most critical Ruby security bugs, with the CVE number, CVSS score, affected versions and what to do about each one. It also covers Ruby security basics, the current end-of-life dates and a free way to be told about the next Ruby CVE as soon as it is published.

Key takeaways

  • 1 CVE is in CISA's KEV catalog, so attackers have exploited it in the wild.
  • 14 Ruby CVEs are rated critical (CVSS v3), and 2 new ones were published in the last 12 months.
  • The newest CVE in this guide is CVE-2026-97229, published Oct 13, 2026.
  • Supported Ruby releases today (per endoflife.date): 4.0, 3.4, 3.3. Releases not on the list are past their announced end of life.
  • You can monitor Ruby for free. Vulnario emails you when a new CVE matches your version and the rest of your stack.

How we ranked these Ruby CVEs

We ranked CVEs first by whether CISA lists them as exploited, then by CVSS score (v3 scores before the older v2 scale, which is marked when used), then by publication date (newest first). When a technology has several product entries in NVD, we combined them and removed duplicates. This favors the bugs that matter most in practice, so the guide is a list of the most critical flaws we found, not a complete history.

Every CVE number, score, date and affected version below comes from the NVD record and the CISA KEV catalog, checked on Nov 3, 2026. Scores can change when NVD reanalyzes a record, so open the linked record if you need the current value.

The 10 most critical Ruby CVEs at a glance

Most critical Ruby vulnerabilities (data from NVD and CISA KEV)
#CVECVSSPublishedTypeCISA KEV
1CVE-2026-9722910.0 Critical2026-10-13GitLab Community Edition and Enterprise Edition Integer Overflow or WraparoundYes
2CVE-2016-23389.8 Critical2022-09-29Out-of-bounds writeNo
3CVE-2022-287389.8 Critical2022-05-09Critical security flawNo
4CVE-2011-41219.8 Critical2019-11-26Critical security flawNo
5CVE-2018-163959.8 Critical2018-11-16Critical security flawNo
6CVE-2017-177909.8 Critical2017-12-20InjectionNo
7CVE-2017-140649.8 Critical2017-08-31Memory buffer overflowNo
8CVE-2017-114659.8 Critical2017-07-19Out-of-bounds readNo
9CVE-2017-92259.8 Critical2017-05-24Out-of-bounds writeNo
10CVE-2016-23369.8 Critical2017-01-06Critical security flawNo

Each Ruby CVE explained

1. CVE-2026-97229: GitLab Community Edition and Enterprise Edition Integer Overflow or Wraparound

  • CVSS 10.0 Critical
  • In CISA KEV (added 2026-10-29)
  • Published 2026-10-13
  • CWE-190
What NVD says
GitLab has remediated an issue in GitLab CE/EE affecting all versions from 19.2 before 19.2.8, 19.3 before 19.3.5, and 19.4 before 19.4.2 that, under certain conditions, could have allowed an unauthenticated user to execute arbitrary code on the GitLab server via a specially crafted regular expression in a CI/CD configuration, due to insufficient regular expression validation.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
3.3.0 to before 3.3.13; 3.4.0 to before 3.4.12; 4.0.0 to before 4.0.8
What to do
Upgrade to the fixed release for your branch (3.3.13, 3.4.12, 4.0.8) or a later one, then restart the service.
Advisory
Vendor advisory or patch (opens in a new tab)

NVD record for CVE-2026-97229 (opens in a new tab)

2. CVE-2016-2338: Out-of-bounds write

  • CVSS 9.8 Critical
  • Published 2022-09-29
  • CWE-787
What NVD says
An exploitable heap overflow vulnerability exists in the Psych::Emitter start_document function of Ruby. In Psych::Emitter start_document function heap buffer "head" allocation is made based on tags array length. Specially constructed object passed as element of tags array can increase this array size after mentioned allocation and cause heap overflow.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
2.2.2; 2.3.0
What to do
Apply the vendor's security update for your release and restart the service.

NVD record for CVE-2016-2338 (opens in a new tab)

3. CVE-2022-28738: Critical security flaw

  • CVSS 9.8 Critical
  • Published 2022-05-09
  • CWE-415
What NVD says
A double free was found in the Regexp compiler in Ruby 3.x before 3.0.4 and 3.1.x before 3.1.2. If a victim attempts to create a Regexp from untrusted user input, an attacker may be able to write to unexpected memory locations.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
3.0.0 to before 3.0.4; 3.1.0 to before 3.1.2
What to do
Upgrade to the fixed release for your branch (3.0.4, 3.1.2) or a later one, then restart the service.
Advisory
Vendor advisory or patch (opens in a new tab)

NVD record for CVE-2022-28738 (opens in a new tab)

4. CVE-2011-4121: Critical security flaw

  • CVSS 9.8 Critical
  • Published 2019-11-26
  • CWE-326
What NVD says
The OpenSSL extension of Ruby (Git trunk) versions after 2011-09-01 up to 2011-11-03 always generated an exponent value of '1' to be used for private RSA key generation. A remote attacker could use this flaw to bypass or corrupt integrity of services, depending on strong private RSA keys generation mechanism.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
1.8.7.334 to before 1.9.3
What to do
Upgrade to 1.9.3 or a later release, then restart the service.

NVD record for CVE-2011-4121 (opens in a new tab)

5. CVE-2018-16395: Critical security flaw

  • CVSS 9.8 Critical
  • Published 2018-11-16
What NVD says
An issue was discovered in the OpenSSL library in Ruby before 2.3.8, 2.4.x before 2.4.5, 2.5.x before 2.5.2, and 2.6.x before 2.6.0-preview3. When two OpenSSL::X509::Name objects are compared using ==, depending on the ordering, non-equal objects may return true.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
2.3.0 through 2.3.7; 2.4.0 through 2.4.4; 2.5.0 through 2.5.1; 2.6.0
What to do
Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).

NVD record for CVE-2018-16395 (opens in a new tab)

6. CVE-2017-17790: Injection

  • CVSS 9.8 Critical
  • Published 2017-12-20
  • CWE-74
What NVD says
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injection attacks, as demonstrated by a Resolv::Hosts::new argument beginning with a '|' character, a different vulnerability than CVE-2017-17405. NOTE: situations with untrusted input may be highly unlikely.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
2.2 through 2.2.8; 2.3 through 2.3.5; 2.4 through 2.4.2; 2.5.0
What to do
Apply the vendor's security update for your release and restart the service.

NVD record for CVE-2017-17790 (opens in a new tab)

7. CVE-2017-14064: Memory buffer overflow

  • CVSS 9.8 Critical
  • Published 2017-08-31
  • CWE-119
What NVD says
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call. The issues lies in using strdup in ext/json/ext/generator/generator.c, which will stop after encountering a '\0' byte, returning a pointer to a string of length zero, which is not the length stored in space_len.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
up to and including 2.2.7; 2.3.0; 2.3.1; 2.3.2
What to do
Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).

NVD record for CVE-2017-14064 (opens in a new tab)

8. CVE-2017-11465: Out-of-bounds read

  • CVSS 9.8 Critical
  • Published 2017-07-19
  • CWE-125
What NVD says
The parser_yyerror function in the UTF-8 parser in Ruby 2.4.1 allows attackers to cause a denial of service (invalid write or read) or possibly have unspecified other impact via a crafted Ruby script, related to the parser_tokadd_utf8 function in parse.y. NOTE: this might have security relevance as a bypass of a $SAFE protection mechanism.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
2.4.1
What to do
Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).

NVD record for CVE-2017-11465 (opens in a new tab)

9. CVE-2017-9225: Out-of-bounds write

  • CVSS 9.8 Critical
  • Published 2017-05-24
  • CWE-787
What NVD says
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7.1.5. A stack out-of-bounds write in onigenc_unicode_get_case_fold_codes_by_str() occurs during regular expression compilation. Code point 0xFFFFFFFF is not properly handled in unicode_unfold_key().
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
up to and including 2.4.1
What to do
Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).

NVD record for CVE-2017-9225 (opens in a new tab)

10. CVE-2016-2336: Critical security flaw

  • CVSS 9.8 Critical
  • Published 2017-01-06
What NVD says
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Attacker passing different type of object than this assumed by developers can cause arbitrary code execution.
How it can be attacked
Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
Affected versions
2.2.2; 2.3.0
What to do
Apply the vendor's security update for your release and restart the service.

NVD record for CVE-2016-2336 (opens in a new tab)

Ruby end of life: which versions still get security fixes

Running a release that still receives security fixes is the most effective way to avoid Ruby vulnerabilities. After a release reaches end of life, newly published CVEs stay unpatched. As of Nov 3, 2026 the supported Ruby releases are 4.0, 3.4, 3.3.

Ruby release support (source: endoflife.date, checked Nov 3, 2026)
ReleaseReleasedEnd of lifeLatestStatus
Ruby 4.0Dec 25, 2025Mar 31, 20294.0.9Supported
Ruby 3.4Dec 24, 2024Mar 31, 20283.4.12Supported
Ruby 3.3Dec 25, 2023Mar 31, 20273.3.13Supported
Ruby 3.2Dec 25, 2022Mar 31, 20263.2.11End of life
Ruby 3.1Dec 25, 2021Mar 26, 20253.1.7End of life
Ruby 3.0Dec 25, 2020Apr 23, 20243.0.7End of life
Ruby 2.7Dec 25, 2019Mar 31, 20232.7.8End of life
Ruby 2.6Dec 25, 2018Mar 31, 20222.6.10End of life

Dates come from endoflife.date (opens in a new tab), which tracks each project's own support policy. Confirm them with the vendor before planning an upgrade.

How to check if your Ruby is vulnerable

Find the exact version first, then compare it with the affected and fixed versions in each CVE above.

ruby -v

On Linux, Debian, Ubuntu and RHEL-based distributions often backport security fixes and keep the old version number, so a package that looks old can already be patched. Check your distribution's own security tracker or the package changelog before concluding that a server is exposed.

Ruby security checklist

  1. Run a supported release and move to the next branch before the current one reaches end of life.
  2. Apply patch releases promptly.
  3. Pin and audit your dependencies, and update the vulnerable ones.
  4. Run applications as an unprivileged user.
  5. Disable features and functions your application does not need.

Where you run Ruby matters as much as how you patch it. Whether your site lives on a VPS, a dedicated server or shared hosting (opens in a new tab), check who is responsible for updating Ruby: on most plans the operating system and applications are yours to patch unless the plan says otherwise.

Your stack is bigger than Ruby. A flaw anywhere in the chain can be the way in, so also review our guides to Rails vulnerabilities, PostgreSQL vulnerabilities and Debian vulnerabilities.

How to get alerted about new Ruby vulnerabilities

NVD received 2 new Ruby CVEs in the last twelve months, and critical ones can be exploited within days. Reading advisories by hand is easy to forget, so most teams automate it. You have three practical options:

  • Follow the vendor's announcements and your distribution's security list. They are accurate but cover only one product and you read them manually.
  • Query the NVD feed yourself. It is complete and needs scripting, filtering and a mail or chat integration to maintain.
  • Use a stack-based alert service. You pick your technologies once and receive an email when a matching CVE appears.

Vulnario is the third option, and it is free to start. It scans the National Vulnerability Database, the CISA KEV catalog and GitHub Security Advisories every hour. You choose Ruby and the rest of your stack, confirm your email with a code, and the alerts begin. Each email includes the CVE number, the CVSS score, a marker when CISA lists the flaw as actively exploited, the attack vector, a patch or advisory link and a suggested time frame to fix it.

  • Free: all technologies, alerts grouped at most every 12 hours.
  • Pro ($29/month): alerts are sent on the next hourly scan, so you hear about a new CVE up to 12 hours earlier.

Few stacks run Ruby alone. These guides cover the technologies it is most often deployed with.

Frequently asked questions about Ruby vulnerabilities

What are the most critical Ruby vulnerabilities?

Based on NVD scores and CISA's exploited-vulnerability catalog, the most critical Ruby CVEs include CVE-2026-97229 (CVSS 10.0), CVE-2016-2338 (CVSS 9.8), CVE-2022-28738 (CVSS 9.8). The guide above ranks the 10 most critical with affected versions and fixes.

Have Ruby vulnerabilities been exploited in real attacks?

Yes. CISA's Known Exploited Vulnerabilities (KEV) catalog lists 1 Ruby CVE, including CVE-2026-97229. Treat these as the highest priority to patch.

How many vulnerabilities does Ruby have?

As of Nov 3, 2026 the National Vulnerability Database lists 93 CVEs for Ruby, with 14 rated critical by CVSS v3. 2 were published in the previous twelve months.

Which Ruby versions are still supported?

As of Nov 3, 2026, endoflife.date lists these Ruby releases as supported: 4.0, 3.4, 3.3. Releases that are not listed are past their announced end of life.

How do I check which Ruby version I run?

Run ruby -v on the server and compare the result with the fixed versions in each CVE. On Debian, Ubuntu and RHEL-based systems, fixes are often backported without changing the version number, so also check your distribution's security tracker.

How can I get alerted when a new Ruby CVE is published?

Add Ruby to a service that watches the National Vulnerability Database, CISA KEV and GitHub Security Advisories. Vulnario does this for free: choose Ruby and the rest of your stack, verify your email, and you receive an alert when a new CVE matches. Free alerts are grouped at most every 12 hours, and Pro sends them on the next hourly scan.

Is Ruby secure?

Ruby is as secure as its patch level. NVD published 2 new Ruby CVEs in the last twelve months, so running a current, supported release and applying security updates promptly is the most effective protection.

What is CVE-2026-97229?

CVE-2026-97229 is a critical Ruby vulnerability with a CVSS score of 10.0, published Oct 13, 2026. GitLab has remediated an issue in GitLab CE/EE affecting all versions from 19.2 before 19.2.8, 19.3 before 19.3.5, and 19.4 before 19.4.2 that, under certain conditions, could have allowed an unauthenticated user to execute arbitrary code on the GitLab server via a specially crafted regular…

Sources

This article is informational and not a substitute for your own risk assessment. CVSS scores and affected versions may change when NVD updates a record.