CVE-2015-4412: Bson Denial of Service Vulnerability

CRITICAL
Advisory Identifier: GHSA-h6rj-8r3c-9gpj
CVSS 9.8
CWE-400
Published
Advisory Summary

CVE-2015-4412 is a CRITICAL (CVSS 9.8) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Bson libraries in the RubyGems ecosystem. The issue involves bson is vulnerable to denial of service due to incorrect regex validation. Remediation is available by upgrading affected packages to version 1.12.3, 3.0.4.

CVE-2015-4412 at a Glance

CVE Identifier CVE-2015-4412
GHSA Identifier GHSA-h6rj-8r3c-9gpj
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Bson
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2015-4412

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

bson fixed: 1.12.3
Upgrade bson to 1.12.3
bson fixed: 3.0.4
Upgrade bson to 3.0.4
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 bson

How to Check if You Are Affected

To determine whether your application is affected by CVE-2015-4412, inspect your project dependencies for Bson:

inspect dependencies for bson

Analyze the terminal output to locate any version of Bson in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.3), 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 Bson, 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

BSON injection vulnerability in the legal function in BSON (bson-ruby) gem before 3.0.4 for Ruby allows remote attackers to cause a denial of service (resource consumption) or inject arbitrary data via a crafted string.

CVE-2015-4412 Affected Bson Versions

2 component(s)
Fixed Versions:
1.12.33.0.4
Product / Package Ecosystem Affected Versions Fixed Version
bson
RubyGems
< 1.12.3
1.12.3
bson
RubyGems
≥ 2.0
< 3.0.4
3.0.4

References

Frequently Asked Questions

What is CVE-2015-4412?
CVE-2015-4412 is a security vulnerability in Bson involving bson is vulnerable to denial of service due to incorrect regex validation under CWE-400: Uncontrolled Resource Consumption.
Which Bson versions are affected?
Affected versions include releases prior to 1.12.3, 3.0.4 across affected packages: bson.
What version fixes CVE-2015-4412?
Upgrading to 1.12.3, 3.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bson affected?
Yes, bson is affected in releases prior to 1.12.3, 3.0.4. Upgrade your dependency to 1.12.3, 3.0.4 or later.
What is the CVSS score of CVE-2015-4412?
CVE-2015-4412 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2015-4412?
CVE-2015-4412 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-2015-4412?
Run the dependency tree command: 'inspect dependencies for bson'. 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-h6rj-8r3c-9gpj",
  "modified" : "2022-04-25T22:38:49Z",
  "published" : "2018-03-05T19:43:21Z",
  "aliases" : [ "CVE-2015-4412" ],
  "summary" : "bson is vulnerable to denial of service due to incorrect regex validation",
  "details" : "BSON injection vulnerability in the legal function in BSON (bson-ruby) gem before 3.0.4 for Ruby allows remote attackers to cause a denial of service (resource consumption) or inject arbitrary data via a crafted string.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "bson"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.12.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "bson"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0"
      }, {
        "fixed" : "3.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-4412"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/bson-ruby/commit/976da329ff03ecdfca3030eb6efe3c85e6db9999"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1229750"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-h6rj-8r3c-9gpj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb/bson-ruby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/bson-ruby/compare/7446d7c6764dfda8dc4480ce16d5c023e74be5ca...28f34978a85b689a4480b4d343389bf4886522e7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bson/CVE-2015-4412.yml"
  }, {
    "type" : "WEB",
    "url" : "https://sakurity.com/blog/2015/06/04/mongo_ruby_regexp.html"
  }, {
    "type" : "WEB",
    "url" : "http://sakurity.com/blog/2015/06/04/mongo_ruby_regexp.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2015/06/06/3"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/75045"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:39:12Z",
    "nvd_published_at" : null
  }
}