CVE-2021-22880
Active Record subject to Regular Expression Denial-of-Service (ReDoS)
Also known as GHSA-8hc4-xxm3-5ppp
Mitigation
- Upgrade activerecord to one of 5.2.4.5, 6.0.3.5, 6.1.2.1 (or later in the same release line).
Who should check
- Projects that depend on RubyGems package activerecord (>= 5.0.0, < 5.2.4.5)
- Anyone running https://github.com/rails/rails Fixed in 6.1.2.1, 6.0.3.5, 5.2.4.5
Vulnerability facts
- Affected
- activerecord >= 5.0.0, < 5.2.4.5
- Fixed in
- 5.2.4.5, 6.0.3.5, 6.1.2.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, NVD)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 4.49% chance of exploitation in 30 days (percentile 92, 2026-11-26)
- CWE
- CWE-400
- Modified
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| RubyGems activerecord | >= 5.0.0, < 5.2.4.5 | 5.2.4.5, 6.0.3.5, 6.1.2.1 | osv |
| https://github.com/rails/rails | Fixed in 6.1.2.1, 6.0.3.5, 5.2.4.5 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-22880. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-22880.md Affected: activerecord >= 5.0.0, < 5.2.4.5 Fixed in: 5.2.4.5, 6.0.3.5, 6.1.2.1 Steps: 1. Search this machine and project for activerecord (RubyGems), https://github.com/rails/rails: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MO5OJ3F4ZL3UXVLJO6ECANRVZBNRS2IH/
- https://www.debian.org/security/2021/dsa-4929
- https://nvd.nist.gov/vuln/detail/CVE-2021-22880
Exploits and PoCs
Other
- https://security.netapp.com/advisory/ntap-20210805-0009/
- https://github.com/rails/rails
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2021-22880.yml
- https://groups.google.com/g/rubyonrails-security/c/ZzUqCh9vyhI
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MO5OJ3F4ZL3UXVLJO6ECANRVZBNRS2IH
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3
- https://security.netapp.com/advisory/ntap-20210805-0009
FAQ
Is CVE-2021-22880 being exploited?
There is no confirmed exploitation: CVE-2021-22880 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 4.49% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-22880?
High: CVSS 7.5 (v3.1, scored by NVD). Remote, no login needed.
Which versions are affected by CVE-2021-22880?
activerecord >= 5.0.0, < 5.2.4.5.
Is there a fix for CVE-2021-22880?
Yes. Fixed in 5.2.4.5, 6.0.3.5, 6.1.2.1. Upgrade activerecord to one of 5.2.4.5, 6.0.3.5, 6.1.2.1 (or later in the same release line).
How do I check if I'm affected by CVE-2021-22880?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.