VYPR
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.

PackageAffected versionsPatched versions
private_address_checkRubyGems
< 0.4.00.4.0

Affected products

2

Patches

1
58a0d7fe31de

Fix 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

News mentions

0

No linked articles in our index yet.