CVE-2017-0904: Private address check Private_address_check Vulnerable To Bypass Of Vulnerability

MODERATE
Advisory Identifier: GHSA-hxhj-hp9m-qwc4
CWE-242
Published
Advisory Summary

CVE-2017-0904 is a MODERATE private_address_check vulnerable to bypass of vulnerability (CWE-242: Use of Inherently Dangerous Function) affecting Private address check libraries in the RubyGems ecosystem. The issue involves private_address_check vulnerable to bypass of resolv.getaddresses method. Remediation is available by upgrading affected packages to version 0.4.0.

CVE-2017-0904 at a Glance

CVE Identifier CVE-2017-0904
GHSA Identifier GHSA-hxhj-hp9m-qwc4
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-242: Use of Inherently Dangerous Function
Affected Product Private address check
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2017-0904

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

private_address_check fixed: 0.4.0
Upgrade private_address_check to 0.4.0
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 private_address_check

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-0904, inspect your project dependencies for Private address check:

inspect dependencies for private_address_check

Analyze the terminal output to locate any version of Private address check in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.0), 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-242: Use of Inherently Dangerous Function, where the product calls a function that can never be guaranteed to work safely. In Private address check, 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

The private_address_check ruby gem before 0.4.0 is vulnerable to a bypass due to use of Ruby's `Resolv.getaddresses` method, which is OS-dependent and should not be relied upon for security measures, such as when used to blacklist private network addresses to prevent server-side request forgery.

CVE-2017-0904 Affected Private address check Versions

1 component(s)
Fixed Versions:
0.4.0
Product / Package Ecosystem Affected Versions Fixed Version
private_address_check
RubyGems
< 0.4.0
0.4.0

References

Frequently Asked Questions

What is CVE-2017-0904?
CVE-2017-0904 is a security vulnerability in Private address check involving private_address_check vulnerable to bypass of Resolv.getaddresses method under CWE-242: Use of Inherently Dangerous Function.
Which Private address check versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: private_address_check.
What version fixes CVE-2017-0904?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is private_address_check affected?
Yes, private_address_check is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What CWE is associated with CVE-2017-0904?
CVE-2017-0904 is classified under CWE-242: Use of Inherently Dangerous Function (The product calls a function that can never be guaranteed to work safely.).
How can I check RubyGems dependencies for CVE-2017-0904?
Run the dependency tree command: 'inspect dependencies for private_address_check'. 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-hxhj-hp9m-qwc4",
  "modified" : "2023-01-23T17:38:44Z",
  "published" : "2017-11-29T23:21:05Z",
  "aliases" : [ "CVE-2017-0904" ],
  "summary" : "private_address_check vulnerable to bypass of Resolv.getaddresses method",
  "details" : "The private_address_check ruby gem before 0.4.0 is vulnerable to a bypass due to use of Ruby's `Resolv.getaddresses` method, which is OS-dependent and should not be relied upon for security measures, such as when used to blacklist private network addresses to prevent server-side request forgery.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "private_address_check"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-0904"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jtdowney/private_address_check/issues/1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jtdowney/private_address_check/commit/58a0d7fe31de339c0117160567a5b33ad82b46af"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/287245"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/287835"
  }, {
    "type" : "WEB",
    "url" : "https://edoverflow.com/2017/ruby-resolv-bug"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-242" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:41:23Z",
    "nvd_published_at" : null
  }
}