mpcium icon indicating copy to clipboard operation
mpcium copied to clipboard

Bug: Tampered message when a node disconnect and rejoin

Open anhthii opened this issue 1 year ago • 4 comments

Image

This doesn't happen all the time but we disconnect and rejoin multiple times then we will encounter this error

anhthii avatar Aug 16 '25 05:08 anhthii

cc @nann-cheng , I'm debugging this

anhthii avatar Aug 16 '25 05:08 anhthii

Cause of bug:

You set

exchangeComplete: make(chan struct{}, 1),

While, e.exchangeComplete <- struct{}{} is signaled in ecdh message listener, thus, after the second time this signal is invoked, without WaitForExchangeComplete consuming it, it will block the message receiver forever, thus preventing old nodes from receiving correct symmetric key.

nann-cheng avatar Aug 18 '25 14:08 nann-cheng

my bad. thanks for help debugging this

anhthii avatar Aug 18 '25 15:08 anhthii

fix in https://github.com/fystack/mpcium/pull/95

anhthii avatar Aug 22 '25 02:08 anhthii