Open c4-bot-8 opened 11 months ago
DadeKuma marked the issue as duplicate of #410
DadeKuma marked the issue as sufficient quality report
@DadeKuma - can you please check this, not sure its a dupe of #410
@0xean The main reasoning was that both issues rely on an observer escalation and the impact was similar; however, re-reading this, I agree that these might be considered separate issues, as they also have different mitigation steps.
thanks @DadeKuma for taking another pass, I am gonna treat it them as separate and welcome comments during QA about it.
0xean marked the issue as not a duplicate
0xean marked the issue as satisfactory
lumtis (sponsor) confirmed
0xean marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/crosschain/keeper/msg_server_add_to_outtx_tracker.go#L34 https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/crosschain/keeper/msg_server_add_to_intx_tracker.go#L49-L53 https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/crosschain/keeper/keeper_chain_nonces.go#L145
Vulnerability details
Impact
A single observer has too much power over the ZetaChain network, allowing them to halt outbound cctxs and steal funds.
Proof of Concept
Both the
MsgAddToInTxTracker
andMsgAddToOutTxTracker
messages allow observers to add a transaction to the tracker without providing Merkle proof to verify if the transaction is valid.This is a real risk to ZetaChain as a single malicious observer is able to cause significant harm.
For example, the
MsgAddToInTxTracker
message can be misused in the following ways:InTxTracker
with a lot of transactions: Add transactions that will cause the zetaclients to fail/error while processing them -> this will cause the zetaclient to stop processing other legitimate messages in theObserveTrackerSuggestions
function. A tx with a hash that's non-existent causes the zetaclient to error and stops the current loop iteration of the tracker tx'stx.To
. This causes the zetaclients to vote for a "fake" transaction which could forgeDeposit
orZetaSent
events. Consequently, this allows draining funds.Similarly, trusting observers to not misbehave with
MsgAddToOutTxTracker
messages imposes a trust issue as well.Moreover, a single malicious observer can mess with the external chain nonces by using the (deprecated)
MsgNonceVoter
message, halting outbound cctx's due to nonce mismatches.Tools Used
Manual review
Recommended mitigation steps
Re-consider the trust model of the
MsgAddToInTxTracker
andMsgAddToOutTxTracker
messages and possibly also require a Merkle proof from observers.Assessed type
Access Control