CVE-2021-22880 — activerecord
HIGHCVE-2021-22880 is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in activerecord. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for activerecord — see the affected versions and patch details below.
Active Record subject to Regular Expression Denial-of-Service (ReDoS)
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
activerecord💎activerecord💎activerecordReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | activerecord | ≥ 5.0.0&&< 5.2.4.5 | 5.2.4.5bundle update activerecord --conservative |
| 💎RubyGems | activerecord | ≥ 6.0.0&&< 6.0.3.5 | 6.0.3.5bundle update activerecord --conservative |
| 💎RubyGems | activerecord | ≥ 6.1.0&&< 6.1.2.1 | 6.1.2.1bundle update activerecord --conservative |
Affected Products
fedorafedoraprojectrailsrubyonrailsResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for activerecord, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update activerecord to 5.2.4.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-22880 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2021-22880 in your dependencies?
Find it across RubyGems, including transitive dependencies.