CVE-2015-4020: Rubygems update RubyGems Improper Input Validation Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-qv62-xfj6-32xm
CWE-20
Published
Advisory Summary

CVE-2015-4020 is a MODERATE rubygems improper input validation vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Rubygems update libraries in the RubyGems ecosystem. The issue involves rubygems improper input validation vulnerability. Remediation is available by upgrading affected packages to version 2.0.17, 2.2.5, 2.4.8.

CVE-2015-4020 at a Glance

CVE Identifier CVE-2015-4020
GHSA Identifier GHSA-qv62-xfj6-32xm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Rubygems update
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2015-4020

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

rubygems-update fixed: 2.0.17
Upgrade rubygems-update to 2.0.17
rubygems-update fixed: 2.2.5
Upgrade rubygems-update to 2.2.5
rubygems-update fixed: 2.4.8
Upgrade rubygems-update to 2.4.8
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 rubygems-update

How to Check if You Are Affected

To determine whether your application is affected by CVE-2015-4020, inspect your project dependencies for Rubygems update:

inspect dependencies for rubygems-update

Analyze the terminal output to locate any version of Rubygems update in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.17), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Rubygems update, 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

RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.3.x before 2.4.8 does not validate the hostname when fetching gems or making API requests, which allows remote attackers to redirect requests to arbitrary domains via a crafted DNS SRV record with a domain that is suffixed with the original domain name, aka a "DNS hijack attack." NOTE: this vulnerability exists because of an incomplete fix for CVE-2015-3900.

CVE-2015-4020 Affected Rubygems update Versions

3 component(s)
Fixed Versions:
2.0.172.2.52.4.8
Product / Package Ecosystem Affected Versions Fixed Version
rubygems-update
RubyGems
< 2.0.17
2.0.17
rubygems-update
RubyGems
≥ 2.1.0.rc.1
< 2.2.5
2.2.5
rubygems-update
RubyGems
≥ 2.3.0
< 2.4.8
2.4.8

References

Frequently Asked Questions

What is CVE-2015-4020?
CVE-2015-4020 is a security vulnerability in Rubygems update involving RubyGems Improper Input Validation vulnerability under CWE-20: Improper Input Validation.
Which Rubygems update versions are affected?
Affected versions include releases prior to 2.0.17, 2.2.5, 2.4.8 across affected packages: rubygems-update.
What version fixes CVE-2015-4020?
Upgrading to 2.0.17, 2.2.5, 2.4.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rubygems-update affected?
Yes, rubygems-update is affected in releases prior to 2.0.17, 2.2.5, 2.4.8. Upgrade your dependency to 2.0.17, 2.2.5, 2.4.8 or later.
What CWE is associated with CVE-2015-4020?
CVE-2015-4020 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check RubyGems dependencies for CVE-2015-4020?
Run the dependency tree command: 'inspect dependencies for rubygems-update'. 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-qv62-xfj6-32xm",
  "modified" : "2023-05-04T21:14:40Z",
  "published" : "2022-05-17T00:16:50Z",
  "aliases" : [ "CVE-2015-4020" ],
  "summary" : "RubyGems Improper Input Validation vulnerability",
  "details" : "RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.3.x before 2.4.8 does not validate the hostname when fetching gems or making API requests, which allows remote attackers to redirect requests to arbitrary domains via a crafted DNS SRV record with a domain that is suffixed with the original domain name, aka a \"DNS hijack attack.\"\n\nNOTE: this vulnerability exists because of an incomplete fix for CVE-2015-3900.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rubygems-update"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rubygems-update"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0.rc.1"
      }, {
        "fixed" : "2.2.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rubygems-update"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.4.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-4020"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubygems/rubygems/commit/5c7bfb5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rubygems/rubygems"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rubygems-update/CVE-2015-4020.yml"
  }, {
    "type" : "WEB",
    "url" : "https://puppet.com/security/cve/CVE-2015-3900"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228084212/http://www.securityfocus.com/bid/75431"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228085830/https://puppet.com/security/cve/CVE-2015-3900"
  }, {
    "type" : "WEB",
    "url" : "https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478"
  }, {
    "type" : "WEB",
    "url" : "https://www.trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900"
  }, {
    "type" : "WEB",
    "url" : "http://blog.rubygems.org/2015/06/08/2.2.5-released.html"
  }, {
    "type" : "WEB",
    "url" : "http://blog.rubygems.org/2015/06/08/2.4.8-released.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/topics/security/bulletinoct2015-2511968.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/75431"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-04T21:14:40Z",
    "nvd_published_at" : "2015-08-25T17:59:00Z"
  }
}