CVE-2021-22880 — Vulnerability in activerecord — CVE Details
Active Record subject to Regular Expression Denial-of-Service (ReDoS)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (4.49%). Schedule for your next planned update.
Does your project use an affected activerecord version?
Paste your Gemfile.lock to check it for CVE-2021-22880 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
The PostgreSQL adapter in Active Record before 6.1.2.1, 6.0.3.5, 5.2.4.5 suffers from a regular expression denial of service (REDoS) vulnerability. Carefully crafted input can cause the input validation in the money type of the PostgreSQL adapter in Active Record to spend too much time in a regular expression, resulting in the potential for a DoS attack. This only impacts Rails applications that are using PostgreSQL along with money type columns that take user input.
Advisory Timeline
- First published March 2, 2021 (2096 days ago).
- Last revised February 20, 2024 — 1085 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install activerecord -v 6.1.2.1
gem install activerecord -v 5.2.4.5
gem install activerecord -v 6.0.3.5
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| activerecord RubyGems · Affected: 6.1.0, 6.1.1, 6.1.2 | 6.1.2.1 |
| activerecord RubyGems · Affected: 5.0.0, 5.0.0.1, 5.0.1, 5.0.1.rc1 (+53 more) | 5.2.4.5 |
| activerecord RubyGems · Affected: 6.0.0, 6.0.1, 6.0.1.rc1, 6.0.2 (+10 more) | 6.0.3.5 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-400Uncontrolled Resource ConsumptionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-22880ADVISORY
- https://hackerone.com/reports/1023899WEB
- https://discuss.rubyonrails.org/t/cve-2021-22880-possible-dos-vulnerability-in-active-record-postgresql-adapter/77129WEB
- https://github.com/rails/railsWEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2021-22880.ymlWEB
- https://groups.google.com/g/rubyonrails-security/c/ZzUqCh9vyhIWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MO5OJ3F4ZL3UXVLJO6ECANRVZBNRS2IHWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3WEB
- https://security.netapp.com/advisory/ntap-20210805-0009WEB
- https://www.debian.org/security/2021/dsa-4929WEB
Frequently Asked Questions
- What is CVE-2021-22880?
- Active Record subject to Regular Expression Denial-of-Service (ReDoS). This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2021-22880?
- CVE-2021-22880 affects activerecord. It has a 4.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-22880 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 10% of EPSS-scored vulnerabilities — 92.3% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2022-32224CRITICAL
Active Record RCE bug with Serialized Columns
- CVE-2013-3221CRITICAL
Active Record component in Ruby on Rails has a data-type injection vulnerability
- CVE-2022-44566HIGH
Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter
- CVE-2026-126366HIGH
msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM
- CVE-2023-22794HIGH
SQL Injection Vulnerability via ActiveRecord comments
- CVE-2016-6317HIGH
ActiveRecord in Ruby on Rails allows database-query bypass
- CVE-2026-126081HIGH
Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
- CVE-2025-55193MEDIUM
Active Record logging vulnerable to ANSI escape injection