CVE-2018-3759: Private address check Private_address_check Contains Race Condition Vulnerability

HIGH
Advisory Identifier: GHSA-2xvj-j3qh-x8c3
CWE-362
Published
Advisory Summary

CVE-2018-3759 is a HIGH private_address_check contains race condition vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Private address check libraries in the RubyGems ecosystem. The issue involves private_address_check contains race condition. Remediation is available by upgrading affected packages to version 0.5.0.

CVE-2018-3759 at a Glance

CVE Identifier CVE-2018-3759
GHSA Identifier GHSA-2xvj-j3qh-x8c3
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Private address check
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2018-3759

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.5.0
Upgrade private_address_check to 0.5.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-2018-3759, 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.5.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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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.5.0 is vulnerable to a time-of-check time-of-use (TOCTOU) race condition due to the address the socket uses not being checked. DNS entries with a TTL of 0 can trigger this case where the initial resolution is a public address but the subsequent resolution is a private address.

CVE-2018-3759 Affected Private address check Versions

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

References

Frequently Asked Questions

What is CVE-2018-3759?
CVE-2018-3759 is a security vulnerability in Private address check involving private_address_check contains race condition under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Private address check versions are affected?
Affected versions include releases prior to 0.5.0 across affected packages: private_address_check.
What version fixes CVE-2018-3759?
Upgrading to 0.5.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.5.0. Upgrade your dependency to 0.5.0 or later.
What CWE is associated with CVE-2018-3759?
CVE-2018-3759 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check RubyGems dependencies for CVE-2018-3759?
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-2xvj-j3qh-x8c3",
  "modified" : "2023-08-25T21:42:19Z",
  "published" : "2018-07-31T18:13:05Z",
  "aliases" : [ "CVE-2018-3759" ],
  "summary" : "private_address_check contains race condition",
  "details" : "The private_address_check ruby gem before 0.5.0 is vulnerable to a time-of-check time-of-use (TOCTOU) race condition due to the address the socket uses not being checked. DNS entries with a TTL of 0 can trigger this case where the initial resolution is a public address but the subsequent resolution is a private address.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "private_address_check"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3759"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jtdowney/private_address_check/commit/4068228187db87fea7577f7020099399772bb147"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-2xvj-j3qh-x8c3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jtdowney/private_address_check"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/private_address_check/CVE-2018-3759.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:53:26Z",
    "nvd_published_at" : null
  }
}