High severity8.1NVD Advisory· Published Nov 13, 2017· Updated May 13, 2026
CVE-2017-0904
CVE-2017-0904
Description
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
private_address_checkRubyGems | < 0.4.0 | 0.4.0 |
Affected products
2- cpe:2.3:a:private_address_check_project:private_address_check:*:*:*:*:*:ruby:*:*Range: <0.4.0
- jtdowney/private_address_check ruby gemv5Range: Versions before 0.4.0
Patches
158a0d7fe31deFix bypass bug with malformed addresses
2 files changed · +6 −0
lib/private_address_check.rb+2 −0 modified@@ -31,6 +31,8 @@ def private_address?(address) def resolves_to_private_address?(hostname) ips = Resolv.getaddresses(hostname) + return true if ips.empty? + ips.any? do |ip| private_address?(ip) end
test/private_address_check_test.rb+4 −0 modified@@ -35,4 +35,8 @@ def test_private_hostname_for_public_addresses def test_private_hostname_for_private_addresses assert PrivateAddressCheck.resolves_to_private_address?("localhost") end + + def test_private_address_for_malformed_addresses + assert PrivateAddressCheck.resolves_to_private_address?("127.1") + end end
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- hackerone.com/reports/287245nvdIssue TrackingMitigationPatchThird Party AdvisoryWEB
- edoverflow.com/2017/ruby-resolv-bug/nvdIssue TrackingThird Party Advisory
- github.com/advisories/GHSA-hxhj-hp9m-qwc4ghsaADVISORY
- github.com/jtdowney/private_address_check/commit/58a0d7fe31de339c0117160567a5b33ad82b46afnvdThird Party AdvisoryWEB
- github.com/jtdowney/private_address_check/issues/1nvdIssue TrackingThird Party AdvisoryWEB
- hackerone.com/reports/287835nvdPermissions RequiredThird Party AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2017-0904ghsaADVISORY
- edoverflow.com/2017/ruby-resolv-bugghsaWEB
News mentions
0No linked articles in our index yet.