You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following security issue concerns both go-libp2p-kad-dht and go-kademlia.
Each query needs to keep track of which peers it is (1) already queried, (2) couldn't connect, (3) waiting on a response, or (4) didn't query yet.
A peer should not be marked as couldn't connect, after the first dial failed.
Let's consider the following scenario. A is looking for the 20 closest peers to a specific key (e.g to allocate a provider record). As it converges, A sends a request to B replying with closer peers to the target key. B response include the peer.AddrInfo of C, but with invalid multiaddresses. A tries to query C but cannot connect, as it doesn't know the right multiaddress of C. A marks C as couldn't connect. Later, A receives a response from D containing C's actual multiaddress. A will not try to contact C again, because it considers that this peer.ID is unresponsive. If C is among the 20 closest peers to the target key, then A will miss it, even though it could have reached it.
This has security implications, because it facilitates eclipse attacks. Multiple malicious peers can make it hard to discover a victim, by spreading an incorrect multiaddress. It wouldn't prevent honest nodes to provide the actual address of the victim, but the requester will likely not even try it.
It is OK to classify PeerIDs as (1) already queried, or (4) didn't query yet (and even (3) waiting on a response). It would be better not to classify the PeerID as (2) couldn't connect, but rather the union of peer.ID and the attempted multiaddress. This would allow the query to try connecting to a new multiaddress if a new one is discovered in the future.
The text was updated successfully, but these errors were encountered:
Major features of this large PR:
* Cleaning up the `SimpleQuery` module
* Added 100% test coverage for the `SimpleQuery` module
* Small changes introduced in other modules to make sure their interface
can be used by `Query` implementations
* Completed test coverage of other modules
* Fix flaky tests in the `libp2pendpoint` module
* Addressing #38
The following security issue concerns both go-libp2p-kad-dht and go-kademlia.
Each query needs to keep track of which peers it is (1)
already queried
, (2)couldn't connect
, (3)waiting on a response
, or (4)didn't query yet
.A peer should not be marked as
couldn't connect
, after the first dial failed.Let's consider the following scenario.
A
is looking for the 20 closest peers to a specific key (e.g to allocate a provider record). As it converges,A
sends a request toB
replying with closer peers to the target key.B
response include thepeer.AddrInfo
ofC
, but with invalid multiaddresses.A
tries to queryC
but cannot connect, as it doesn't know the right multiaddress ofC
.A
marksC
ascouldn't connect
. Later,A
receives a response fromD
containingC
's actual multiaddress.A
will not try to contactC
again, because it considers that thispeer.ID
is unresponsive. IfC
is among the 20 closest peers to the target key, thenA
will miss it, even though it could have reached it.This has security implications, because it facilitates eclipse attacks. Multiple malicious peers can make it hard to discover a victim, by spreading an incorrect multiaddress. It wouldn't prevent honest nodes to provide the actual address of the victim, but the requester will likely not even try it.
It is OK to classify PeerIDs as (1)
already queried
, or (4)didn't query yet
(and even (3)waiting on a response
). It would be better not to classify the PeerID as (2)couldn't connect
, but rather the union of peer.ID and the attempted multiaddress. This would allow the query to try connecting to a new multiaddress if a new one is discovered in the future.The text was updated successfully, but these errors were encountered: