Submitted by ciphermarco, also found by ChristiansWhoHack and zhaojie
As it is, NonceVoter does not count votes or perform any similar operations. A single observer can use it to change chain nonces. Although there is a comment pointing this function is deprecated, it critically influences the system with its broken implementation. Arbitrarily changing nonces for the connected chains can be used to completely break the functioning of the chain and cause loss of funds.
This function is restricted to validator observers (k.zetaObserverKeeper.IsAuthorized(ctx, msg.Creator, chain)):
After this check, the entire voting logic is essentially ignored, with a relevant part only drafted and commented, and the chain nonce is simply set:
This can be easily tested inside one of the hosts in the smoke-tests:
After the above commands, you can also use the command zetacored q crosschain list-chain-nonces inside zetacored1 to check the 1337 nonce has been set.
One simple way to halt critical operations of the chain and cause funds to be stuck is to make the function UpdateNonce in cctx_utils.go fail. Luckily, there is a check that causes this function to fail and return an error, and all we need to do is to change the chain nonce:
All a faulty or compromised observer needs to do is to use NonceVoter to desynchronise the nonces for each chain, and this error will be consistently returned by UpdateNonce for all chains.
These are critical functions that depend on UpdateNonce:
Essentially, transactions will be halted and the funds stuck.
Code Editor, Docker.
Implement the correct voting logic or remove this message servers function from the code. In the codebase, it seems there is already another design choice for setting chain nonces that does not depend on this function, so the best mitigation is probably to remove this function altogether.
lumtis (ZetaChain) confirmed
