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
| # | CVE | CVSS | Published | Type | CISA KEV |
|---|---|---|---|---|---|
| 1 | CVE-2026-97229 | 10.0 Critical | 2026-10-13 | GitLab Community Edition and Enterprise Edition Integer Overflow or Wraparound | Yes |
| 2 | CVE-2016-2338 | 9.8 Critical | 2022-09-29 | Out-of-bounds write | No |
| 3 | CVE-2022-28738 | 9.8 Critical | 2022-05-09 | Critical security flaw | No |
| 4 | CVE-2011-4121 | 9.8 Critical | 2019-11-26 | Critical security flaw | No |
| 5 | CVE-2018-16395 | 9.8 Critical | 2018-11-16 | Critical security flaw | No |
| 6 | CVE-2017-17790 | 9.8 Critical | 2017-12-20 | Injection | No |
| 7 | CVE-2017-14064 | 9.8 Critical | 2017-08-31 | Memory buffer overflow | No |
| 8 | CVE-2017-11465 | 9.8 Critical | 2017-07-19 | Out-of-bounds read | No |
| 9 | CVE-2017-9225 | 9.8 Critical | 2017-05-24 | Out-of-bounds write | No |
| 10 | CVE-2016-2336 | 9.8 Critical | 2017-01-06 | Critical security flaw | No |
Each Ruby CVE explained
1. CVE-2026-97229: GitLab Community Edition and Enterprise Edition Integer Overflow or Wraparound
- 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)
2. CVE-2016-2338: Out-of-bounds write
- 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.
3. CVE-2022-28738: Critical security flaw
- 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)
4. CVE-2011-4121: Critical security flaw
- 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.
5. CVE-2018-16395: Critical security flaw
- 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).
6. CVE-2017-17790: Injection
- 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.
7. CVE-2017-14064: Memory buffer overflow
- 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).
8. CVE-2017-11465: Out-of-bounds read
- 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).
9. CVE-2017-9225: Out-of-bounds write
- 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).
10. CVE-2016-2336: Critical security flaw
- 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.
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.
| Release | Released | End of life | Latest | Status |
|---|---|---|---|---|
| Ruby 4.0 | Dec 25, 2025 | Mar 31, 2029 | 4.0.9 | Supported |
| Ruby 3.4 | Dec 24, 2024 | Mar 31, 2028 | 3.4.12 | Supported |
| Ruby 3.3 | Dec 25, 2023 | Mar 31, 2027 | 3.3.13 | Supported |
| Ruby 3.2 | Dec 25, 2022 | Mar 31, 2026 | 3.2.11 | End of life |
| Ruby 3.1 | Dec 25, 2021 | Mar 26, 2025 | 3.1.7 | End of life |
| Ruby 3.0 | Dec 25, 2020 | Apr 23, 2024 | 3.0.7 | End of life |
| Ruby 2.7 | Dec 25, 2019 | Mar 31, 2023 | 2.7.8 | End of life |
| Ruby 2.6 | Dec 25, 2018 | Mar 31, 2022 | 2.6.10 | End 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
- Run a supported release and move to the next branch before the current one reaches end of life.
- Apply patch releases promptly.
- Pin and audit your dependencies, and update the vulnerable ones.
- Run applications as an unprivileged user.
- 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.
Related security guides
Few stacks run Ruby alone. These guides cover the technologies it is most often deployed with.
- Rails vulnerabilities: Ruby on Rails is a full-stack web framework written in Ruby.
- PostgreSQL vulnerabilities: PostgreSQL is a powerful open-source object-relational database.
- Debian vulnerabilities: Debian is a long-established community Linux distribution used widely on servers.
- Go vulnerabilities: Go (Golang) is Google's compiled programming language used for cloud and network software.
- Java vulnerabilities: Java is the language and runtime behind a large share of enterprise software.
- Log4j vulnerabilities: Apache Log4j is the Java logging library at the center of the Log4Shell crisis.
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
- National Vulnerability Database (NVD) (opens in a new tab), CVE records, CVSS scores and CPE counts, checked Nov 3, 2026.
- CISA Known Exploited Vulnerabilities (KEV) catalog (opens in a new tab), checked Nov 3, 2026.
- endoflife.date: Ruby (opens in a new tab), release and support dates, checked Nov 3, 2026.
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.