Submitted by ChristiansWhoHack, also found by ciphermarco (1, 2)
The Observer role is somewhat sensitive but a single observer should not be able to influence a single action to happen. There are multiple observers with parts of the TSS key that vote on events occurring on other chains. From the documentation, Its important to ensure that at no time is any single entity or small fraction of nodes able to sign messages on behalf of ZetaChain on external chains.
When an observer is added, an observer is removed or the admin simply asks, the TSS key is regenerated. The full flow of this is explained below:
Since the TSS (threshold signature) contains all of the funds for the various blockchains (BTC, ETH, etc.) and has complete power to perform actions on the Connector contract, this process must be done securely.
The voting process for this has a catastrophic flaw: the hash used for the voting index does NOT include the public key being voted on. Since this hash is what determines if two votes are the same, the final observer can submit a public key that will be used as the voted on key. The TSS voting requires 100% of voters to agree, making it trivial to time this as the last voter.
If an attacker exploits this, the MigrateTSSFunds message will send all of the TSS value (BTC, ETH, etc.) to an attacker controlled address. Additionally, the TSS address will be used for parsing events and for access control on the connector contract, allowing for complete compromise of these as well transactions as well. So, practically all funds are possible to steal and funds can be created out of thin air.
The proof of concept below was added into the msg_tss_voter_test.go file under the x/crosschain/keeper/ path. This creates 4 observers and the final observer submits the malicious public key. Since the vote passes and the TSS address is replaced, this will be used by the zetaclient for future operations and by the admin on the MigrateTSSFunds call.
To run, use the command go test -v ./x/crosschain/keeper/ -run TestTssHashCollision.
Output of the test being ran:
lumtis (ZetaChain) confirmed
