CVE-2023-22796
Description
A regular expression based DoS vulnerability in Active Support <6.1.7.1 and <7.0.4.1. A specially crafted string passed to the underscore method can cause the regular expression engine to enter a state of catastrophic backtracking. This can cause the process to use large amounts of CPU and memory, leading to a possible DoS vulnerability.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A ReDoS vulnerability in Active Support's underscore method allows attackers to cause a denial of service via crafted strings.
Vulnerability
A regular expression denial of service (ReDoS) vulnerability exists in the Active Support library of Ruby on Rails versions prior to 6.1.7.1 and 7.0.4.1. The underscore method uses a regular expression that is susceptible to catastrophic backtracking when processing a specially crafted string. This leads to excessive CPU and memory consumption [1][4].
Exploitation
An attacker can exploit this vulnerability by providing a malicious string to any application that uses the underscore method. Since this method is commonly used in Rails applications for string transformations, an unauthenticated remote attacker can trigger the DoS condition without requiring any special privileges [1].
Impact
Successful exploitation results in a denial of service, causing the affected application to become unresponsive due to high resource consumption. This can lead to service disruption for legitimate users [1].
Mitigation
The vulnerability is patched in Rails versions 6.1.7.1, 7.0.4.1, and also 6.0.6.1. Users running affected versions should upgrade immediately. No workarounds are available [3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
activesupportRubyGems | < 6.1.7.1 | 6.1.7.1 |
activesupportRubyGems | >= 7.0.0, < 7.0.4.1 | 7.0.4.1 |
Affected products
10- Active Support/Active Supportdescription
- ghsa-coords9 versionspkg:gem/activesupportpkg:rpm/opensuse/rubygem-activesupport-5_1&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/rubygem-activesupport-7.0&distro=openSUSE%20Tumbleweedpkg:rpm/suse/rubygem-activesupport-4_2&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/rubygem-activesupport-4_2&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209pkg:rpm/suse/rubygem-activesupport-5_1&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP1pkg:rpm/suse/rubygem-activesupport-5_1&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP2pkg:rpm/suse/rubygem-activesupport-5_1&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP3pkg:rpm/suse/rubygem-activesupport-5_1&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP4
< 6.1.7.1+ 8 more
- (no CPE)range: < 6.1.7.1
- (no CPE)range: < 5.1.4-150000.3.12.1
- (no CPE)range: < 7.0.4.1-1.1
- (no CPE)range: < 4.2.9-7.15.1
- (no CPE)range: < 4.2.9-7.15.1
- (no CPE)range: < 5.1.4-150000.3.12.1
- (no CPE)range: < 5.1.4-150000.3.12.1
- (no CPE)range: < 5.1.4-150000.3.12.1
- (no CPE)range: < 5.1.4-150000.3.12.1
Patches
22164d4f6a1bdAvoid regex backtracking in Inflector.underscore
1 file changed · +1 −1
activesupport/lib/active_support/inflector/methods.rb+1 −1 modified@@ -97,7 +97,7 @@ def underscore(camel_cased_word) return camel_cased_word.to_s unless /[A-Z-]|::/.match?(camel_cased_word) word = camel_cased_word.to_s.gsub("::", "/") word.gsub!(inflections.acronyms_underscore_regex) { "#{$1 && '_' }#{$2.downcase}" } - word.gsub!(/([A-Z]+)(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/) { ($1 || $2) << "_" } + word.gsub!(/([A-Z])(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/) { ($1 || $2) << "_" } word.tr!("-", "_") word.downcase! word
a7cda7e6aa53Avoid regex backtracking in Inflector.underscore
1 file changed · +1 −2
activesupport/lib/active_support/inflector/methods.rb+1 −2 modified@@ -93,8 +93,7 @@ def underscore(camel_cased_word) return camel_cased_word unless /[A-Z-]|::/.match?(camel_cased_word) word = camel_cased_word.to_s.gsub("::", "/") word.gsub!(inflections.acronyms_underscore_regex) { "#{$1 && '_' }#{$2.downcase}" } - word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2') - word.gsub!(/([a-z\d])([A-Z])/, '\1_\2') + word.gsub!(/([A-Z])(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/) { ($1 || $2) << "_" } word.tr!("-", "_") word.downcase! word
Vulnerability mechanics
Synthesis attempt was rejected by the grounding validator. Re-run pending.
References
11- github.com/advisories/GHSA-j6gc-792m-qgm2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-22796ghsaADVISORY
- www.debian.org/security/2023/dsa-5372mitrevendor-advisory
- discuss.rubyonrails.org/t/cve-2023-22796-possible-redos-based-dos-vulnerability-in-active-supports-underscore/82116ghsaWEB
- github.com/rails/rails/commit/2164d4f6a1bde74b911fe9ba3c8df1b5bf345bf8ghsaWEB
- github.com/rails/rails/commit/a7cda7e6aa5334ab41b1f4b0f671be931be946efghsaWEB
- github.com/rails/rails/releases/tag/v6.1.7.1ghsaWEB
- github.com/rails/rails/releases/tag/v7.0.4.1ghsaWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2023-22796.ymlghsaWEB
- rubyonrails.org/2023/1/17/Rails-Versions-6-0-6-1-6-1-7-1-7-0-4-1-have-been-releasedghsaWEB
- security.netapp.com/advisory/ntap-20240202-0009/mitre
News mentions
0No linked articles in our index yet.