Skip to main content

CVE-2021-22880 — Vulnerability in activerecord — CVE Details

HIGH

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

Published March 2, 2021Updated February 20, 2024Source: OSV

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.

Check my Gemfile.lock

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.

Bundler
Update activerecord to 6.1.2.1 or later
gem install activerecord -v 6.1.2.1
Bundler
Update activerecord to 5.2.4.5 or later
gem install activerecord -v 5.2.4.5
Bundler
Update activerecord to 6.0.3.5 or later
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).

PackageFixed In
activerecord RubyGems · Affected: 6.1.0, 6.1.1, 6.1.26.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-400
    Uncontrolled Resource ConsumptionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

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

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
4.49%
EPSS percentile: 92.3

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

GHSA-8hc4-xxm3-5ppp

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock