Open garth opened 9 months ago
It's also worth noting that since we cannot currently use subcluster.emit
the following will send messages to peers who should not receive it which could be a potential data leak/security issue?
for (const peer of this.subcluster.peers.values()) {
peer.emit('message', data)
}
only peers with the sharedKey will be able to read the contents of the packet (of course you area able to do whatever cryptography you want to do on top of that). the peers listed on sub cluster should only be members of the sub cluster, if you're trying to create a setup where peers that are removed from the sub cluster are no longer able to read the data, that will be an application level security issue. The protocol can not realistically enforce application level security design.
the peers listed on sub cluster should only be members of the sub cluster
The list of peers includes peerIds from outside the cluster.
They must have at one point been a member of the cluster though. When a #join
event happens, the packet is checked for the corresponding subcluster, if in the case it is a match, the peer is added to the subcluster set.
https://github.com/socketsupply/socket/blob/master/api/stream-relay/sugar.js#L284
The subcluster peer list often contains peers that have not joined the subcluster. I guess that this might be because they are relaying, but if that is the case I think they should be hidden.
What OS are you using (
uname -a
, or Windows version)?What version Socket Runtime are you using?
I also tried this on the latest master branch but the results are the same.
What programming language are you using (C/C++/Go/Rust)?
What did you expect to see and what you saw instead?
I would expect that the following would only list peers that have explicitly joined the subcluster.
This list often includes additional peers that are not part of the subcluster.