CVE-2012-6109: Rack Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-h77x-m5q8-c29h
CWE-835
Published
Advisory Summary

CVE-2012-6109 is a MODERATE denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Rack libraries in the RubyGems ecosystem. The issue involves rack vulnerable to redos. Remediation is available by upgrading affected packages to version 1.1.4, 1.2.6, 1.3.7, 1.4.2.

CVE-2012-6109 at a Glance

CVE Identifier CVE-2012-6109
GHSA Identifier GHSA-h77x-m5q8-c29h
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2012-6109

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

rack fixed: 1.1.4
Upgrade rack to 1.1.4
rack fixed: 1.2.6
Upgrade rack to 1.2.6
rack fixed: 1.3.7
Upgrade rack to 1.3.7
rack fixed: 1.4.2
Upgrade rack to 1.4.2
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 rack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2012-6109, inspect your project dependencies for Rack:

inspect dependencies for rack

Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.4), 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Rack, 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

`lib/rack/multipart.rb` in Rack before 1.1.4, 1.2.x before 1.2.6, 1.3.x before 1.3.7, and 1.4.x before 1.4.2 uses an incorrect regular expression, which allows remote attackers to cause a denial of service (infinite loop) via a crafted Content-Disposion header.

CVE-2012-6109 Affected Rack Versions

4 component(s)
Fixed Versions:
1.1.41.2.61.3.71.4.2
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
< 1.1.4
1.1.4
rack
RubyGems
≥ 1.2.0
< 1.2.6
1.2.6
rack
RubyGems
≥ 1.3.0
< 1.3.7
1.3.7
rack
RubyGems
≥ 1.4.0
< 1.4.2
1.4.2

References

Frequently Asked Questions

What is CVE-2012-6109?
CVE-2012-6109 is a security vulnerability in Rack involving Rack vulnerable to REDoS under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Rack versions are affected?
Affected versions include releases prior to 1.1.4, 1.2.6, 1.3.7, 1.4.2 across affected packages: rack.
What version fixes CVE-2012-6109?
Upgrading to 1.1.4, 1.2.6, 1.3.7, 1.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack affected?
Yes, rack is affected in releases prior to 1.1.4, 1.2.6, 1.3.7, 1.4.2. Upgrade your dependency to 1.1.4, 1.2.6, 1.3.7, 1.4.2 or later.
What CWE is associated with CVE-2012-6109?
CVE-2012-6109 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check RubyGems dependencies for CVE-2012-6109?
Run the dependency tree command: 'inspect dependencies for rack'. 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-h77x-m5q8-c29h",
  "modified" : "2023-08-25T23:23:23Z",
  "published" : "2017-10-24T18:33:37Z",
  "aliases" : [ "CVE-2012-6109" ],
  "summary" : "Rack vulnerable to REDoS",
  "details" : "`lib/rack/multipart.rb` in Rack before 1.1.4, 1.2.x before 1.2.6, 1.3.x before 1.3.7, and 1.4.x before 1.4.2 uses an incorrect regular expression, which allows remote attackers to cause a denial of service (infinite loop) via a crafted Content-Disposion header.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.2.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.3.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.4.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-6109"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/c9f65df37a151821eb88ddd1dc404b83e52c52d5"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2013:0544"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2012-6109"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=895277"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/blob/master/README.rdoc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2012-6109.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!msg/rack-devel/1w4_fWEgTdI/XAkSNHjtdTsJ"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21msg/rack-devel/1w4_fWEgTdI/XAkSNHjtdTsJ"
  }, {
    "type" : "WEB",
    "url" : "https://rhn.redhat.com/errata/RHSA-2013-0544.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:39:20Z",
    "nvd_published_at" : "2013-03-01T05:40:00Z"
  }
}