1. 23 11月, 2016 1 次提交
    • 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
  2. 22 2月, 2016 1 次提交
  3. 18 12月, 2015 1 次提交
  4. 27 11月, 2015 1 次提交
  5. 30 9月, 2015 1 次提交
    • F
      p2p/discover: fix race involving the seed node iterator · b4374436
      Felix Lange 提交于
      nodeDB.querySeeds was not safe for concurrent use but could be called
      concurrenty on multiple goroutines in the following case:
      
      - the table was empty
      - a timed refresh started
      - a lookup was started and initiated refresh
      
      These conditions are unlikely to coincide during normal use, but are
      much more likely to occur all at once when the user's machine just woke
      from sleep. The root cause of the issue is that querySeeds reused the
      same leveldb iterator until it was exhausted.
      
      This commit moves the refresh scheduling logic into its own goroutine
      (so only one refresh is ever active) and changes querySeeds to not use
      a persistent iterator. The seed node selection is now more random and
      ignores nodes that have not been contacted in the last 5 days.
      b4374436
  6. 11 8月, 2015 1 次提交
  7. 06 8月, 2015 1 次提交
  8. 24 7月, 2015 1 次提交
  9. 23 7月, 2015 1 次提交
  10. 07 7月, 2015 1 次提交
  11. 10 6月, 2015 1 次提交
  12. 25 5月, 2015 1 次提交
  13. 06 5月, 2015 1 次提交
    • F
      p2p/discover: new distance metric based on sha3(id) · 2adcc31b
      Felix Lange 提交于
      The previous metric was pubkey1^pubkey2, as specified in the Kademlia
      paper. We missed that EC public keys are not uniformly distributed.
      Using the hash of the public keys addresses that. It also makes it
      a bit harder to generate node IDs that are close to a particular node.
      2adcc31b
  14. 30 4月, 2015 2 次提交
  15. 24 4月, 2015 3 次提交
  16. 01 4月, 2015 2 次提交
    • F
    • F
      p2p/discover: implement node bonding · de7af720
      Felix Lange 提交于
      This a fix for an attack vector where the discovery protocol could be
      used to amplify traffic in a DDOS attack. A malicious actor would send a
      findnode request with the IP address and UDP port of the target as the
      source address. The recipient of the findnode packet would then send a
      neighbors packet (which is 16x the size of findnode) to the victim.
      
      Our solution is to require a 'bond' with the sender of findnode. If no
      bond exists, the findnode packet is not processed. A bond between nodes
      α and β is created when α replies to a ping from β.
      
      This (initial) version of the bonding implementation might still be
      vulnerable against replay attacks during the expiration time window.
      We will add stricter source address validation later.
      de7af720
  17. 09 2月, 2015 1 次提交
  18. 07 2月, 2015 1 次提交
  19. 06 2月, 2015 2 次提交