• F
    p2p/discover, p2p/discv5: prevent relay of invalid IPs and low ports · a98d1d67
    Felix Lange 提交于
    The discovery DHT contains a number of hosts with LAN and loopback IPs.
    These get relayed because some implementations do not perform any checks
    on the IP.
    
    go-ethereum already prevented relay in most cases because it verifies
    that the host actually exists before adding it to the local table. But
    this verification causes other issues. We have received several reports
    where people's VPSs got shut down by hosting providers because sending
    packets to random LAN hosts is indistinguishable from a slow port scan.
    
    The new check prevents sending random packets to LAN by discarding LAN
    IPs sent by Internet hosts (and loopback IPs from LAN and Internet
    hosts). The new check also blacklists almost all currently registered
    special-purpose networks assigned by IANA to avoid inciting random
    responses from services in the LAN.
    
    As another precaution against abuse of the DHT, ports below 1024 are now
    considered invalid.
    a98d1d67
table_test.go 35.4 KB