Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter

Description

There is a potential denial of service vulnerability present in ActiveRecord's PostgreSQL adapter.

This has been assigned the CVE identifier CVE-2022-44566.

Versions Affected: All. Not affected: None.

Fixed Versions

  • 2.3.18.47 (Rails LTS, which is a paid service and not part of the rubygem)
  • 3.2.22.34 (Rails LTS, which is a paid service and not part of the rubygem)
  • 4.2.11.27 (Rails LTS, which is a paid service and not part of the rubygem)
  • 5.2.8.15 (Rails LTS, which is a paid service and not part of the rubygem)
  • 6.1.7.1
  • 7.0.4.1

Impact

In ActiveRecord < 7.0.4.1 and < 6.1.7.1, when a value outside the range for a 64bit signed integer is provided to the PostgreSQL connection adapter, it will treat the target column type as numeric. Comparing integer values against numeric values can result in a slow sequential scan resulting in potential Denial of Service.

Releases

The fixed releases are available at the normal locations.

Workarounds

Ensure that user supplied input which is provided to ActiveRecord clauses do not contain integers wider than a signed 64bit representation or floats.

Patches

To aid users who aren't able to upgrade immediately we have provided patches for the supported release series in accordance with our maintenance policy 1 regarding security issues. They are in git-am format and consist of a single changeset.

6-1-Added-integer-width-check-to-PostgreSQL-Quoting.patch - Patch for 6.1 series
7-0-Added-integer-width-check-to-PostgreSQL-Quoting.patch - Patch for 7.0 series

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Browse source ↗
Published (advisory)
2023-01-18 18:21:12 UTC
Updated
2026-01-15 23:23:19 UTC
GitHub reviewed
2023-01-18 18:21:12 UTC
NVD published
2023-02-09

EPSS Score

Score Percentile
2.42% 84.86%

CVSS Scores

Base score Version Severity Vector
7.5 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.

Identifiers

CWEs

CWE id Name
CWE-400 Uncontrolled Resource Consumption

Credits

  • robertoz-01 (analyst)
  • aviyam181199 (analyst)
  • G-Rath (analyst)
  • RDIL (analyst)

Affected packages (2)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
rubygems activerecord >= 7.0.0, < 7.0.4.1 7.0.4.1
rubygems activerecord < 6.1.7.1 6.1.7.1

References

cvelogic Threat Intelligence