CVE-2021-22880 Active Record subject to Regular Expression Denial-of-Service (ReDoS)

High 7.5 Published Updated

Attackers can cause denial of service in Rails applications using PostgreSQL money columns via crafted input triggering ReDoS.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-22880?

CVE-2021-22880 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 11 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-400

Which versions are affected by CVE-2021-22880?

6 open source packages ship an affected version, including activerecord. It affects 2 products.

PackageAffectedFixed in
activerecord RubyGemsFrom 5.0.05.2.4.5
activerecord RubyGemsFrom 5.0.05.2.4.5
activerecord RubyGemsFrom 6.0.06.0.3.5
activerecord RubyGemsFrom 6.0.06.0.3.5
activerecord RubyGemsFrom 6.1.06.1.2.1
activerecord RubyGemsFrom 6.1.06.1.2.1
Linux distribution packages (8)
rubygem-activerecord-5_1 SUSE:Linux Enterprise High Availability Extension 15All versions5.1.4-5.3.3
rubygem-activerecord-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP1All versions5.1.4-5.3.3
rubygem-activerecord-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP2All versions5.1.4-5.3.3
rubygem-activerecord-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP3All versions5.1.4-5.3.3
rubygem-activerecord-4_2 SUSE:OpenStack Cloud Crowbar 8All versions4.2.9-6.6.1
rubygem-activerecord-4_2 SUSE:OpenStack Cloud Crowbar 9All versions4.2.9-6.6.1
rubygem-activerecord-5_1 openSUSE:Leap 15.2All versions5.1.4-lp152.4.3.1
rubygem-activerecord-5_1 openSUSE:Leap 15.3All versions5.1.4-5.3.3

Products include Fedoraproject Fedora, Rubyonrails Rails.

How do I fix CVE-2021-22880?

Upgrade activerecord to a fixed version for your release line: 5.2.4.5, 6.0.3.5 or 6.1.2.1.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2021-22880 being exploited?

There is no known exploitation of CVE-2021-22880 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-22880, GHSA-8hc4-xxm3-5ppp, SUSE-SU-2021:3267-1, SUSE-SU-2021:3634-1, UBUNTU-CVE-2021-22880, openSUSE-SU-2021:1468-1 and 1 more.

Is CVE-2021-22880 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free