CVE-2022-44566: Activerecord Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-579w-22j4-4749
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2022-44566 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Activerecord libraries in the RubyGems ecosystem. The issue involves denial of service vulnerability in activerecord's postgresql adapter. Remediation is available by upgrading affected packages to version 6.1.7.1, 7.0.4.1.

CVE-2022-44566 at a Glance

CVE Identifier CVE-2022-44566
GHSA Identifier GHSA-579w-22j4-4749
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Activerecord
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-44566

To remediate this vulnerability, upgrade all affected Activerecord dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

activerecord fixed: 6.1.7.1
Upgrade activerecord to 6.1.7.1
activerecord fixed: 7.0.4.1
Upgrade activerecord to 7.0.4.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for activerecord

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-44566, inspect your project dependencies for Activerecord:

inspect dependencies for activerecord

Analyze the terminal output to locate any version of Activerecord in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.7.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Activerecord, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2022-44566 Affected Activerecord Versions

2 component(s)
Fixed Versions:
6.1.7.17.0.4.1
Product / Package Ecosystem Affected Versions Fixed Version
activerecord
RubyGems
< 6.1.7.1
6.1.7.1
activerecord
RubyGems
≥ 7.0.0
< 7.0.4.1
7.0.4.1

References

Frequently Asked Questions

What is CVE-2022-44566?
CVE-2022-44566 is a security vulnerability in Activerecord involving Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter under CWE-400: Uncontrolled Resource Consumption.
Which Activerecord versions are affected?
Affected versions include releases prior to 6.1.7.1, 7.0.4.1 across affected packages: activerecord.
What version fixes CVE-2022-44566?
Upgrading to 6.1.7.1, 7.0.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activerecord affected?
Yes, activerecord is affected in releases prior to 6.1.7.1, 7.0.4.1. Upgrade your dependency to 6.1.7.1, 7.0.4.1 or later.
What is the CVSS score of CVE-2022-44566?
CVE-2022-44566 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-44566?
CVE-2022-44566 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2022-44566?
Run the dependency tree command: 'inspect dependencies for activerecord'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-579w-22j4-4749",
  "modified" : "2026-01-15T23:23:18Z",
  "published" : "2023-01-18T18:21:12Z",
  "aliases" : [ "CVE-2022-44566" ],
  "summary" : "Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter",
  "details" : "There is a potential denial of service vulnerability present in ActiveRecord's PostgreSQL adapter.\n\nThis has been assigned the CVE identifier CVE-2022-44566.\n\nVersions Affected: All. Not affected: None.\n\n## Fixed Versions\n\n- 2.3.18.47 (Rails LTS, which is a paid service and not part of the rubygem)\n- 3.2.22.34 (Rails LTS, which is a paid service and not part of the rubygem)\n- 4.2.11.27 (Rails LTS, which is a paid service and not part of the rubygem)\n- 5.2.8.15 (Rails LTS, which is a paid service and not part of the rubygem)\n- 6.1.7.1\n- 7.0.4.1\n\n## Impact\n\nIn 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.\n\n## Releases\n\nThe fixed releases are available at the normal locations.\n\n## Workarounds\n\nEnsure that user supplied input which is provided to ActiveRecord clauses do not contain integers wider than a signed 64bit representation or floats. \n\n## Patches\n\nTo 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.\n\n 6-1-Added-integer-width-check-to-PostgreSQL-Quoting.patch - Patch for 6.1 series\n 7-0-Added-integer-width-check-to-PostgreSQL-Quoting.patch - Patch for 7.0 series",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.7.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.0.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-44566"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/4f44aa9d514e701ada92b5cf08beccf566eeaebf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/82bcdc011e2ff674e7dd8fd8cee3a831c908d29b"
  }, {
    "type" : "WEB",
    "url" : "https://code.jeremyevans.net/2022-11-01-forcing-sequential-scans-on-postgresql.html"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2022-44566-possible-denial-of-service-vulnerability-in-activerecords-postgresql-adapter/82119"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v6.1.7.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v7.0.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2022-44566.yml"
  }, {
    "type" : "WEB",
    "url" : "https://mailchi.mp/railslts/rails-lts-multiple-dos-vulnerabilities-in-rails-rack-and-globalid"
  }, {
    "type" : "WEB",
    "url" : "https://makandracards.com/railslts/508019-rails-5-2-lts-changelog#section-jan-20th-2023-rails-version-5-2-8-15"
  }, {
    "type" : "WEB",
    "url" : "https://rubyonrails.org/2023/1/17/Rails-Versions-6-0-6-1-6-1-7-1-7-0-4-1-have-been-released"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-18T18:21:12Z",
    "nvd_published_at" : "2023-02-09T20:15:00Z"
  }
}