Skip to content
Access control Audit finding Advanced

Observer can halt outbound cctxs and steal funds

A single observer could add transactions to the inbound and outbound trackers without a Merkle proof, causing zetaclients to error or vote for fake transactions. This could halt outbound cross-chain transactions and allow draining funds.

berndartmueller Follow

Originally disclosed on Code4rena

Submitted by berndartmueller

https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/crosschain/keeper/msg_server_add_to_intx_tracker.go#L49-L53

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 and MsgAddToOutTxTracker 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:

  1. Spam with the 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 the ObserveTrackerSuggestions 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’s
  2. Add an inbound transaction that does not have one of the desired contracts as the tx.To. This causes the zetaclients to vote for a “fake” transaction which could forge Deposit or ZetaSent 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.

Please note: This submission demonstrates the impact on cctxs while the “A single malicious observer can fill the block space with MsgGasPriceVoter messages without proper gas compensation resulting in griefing blocks” submission shows how the whole ZetaChain network (not only inbound/outbound cctx’s) can be significantly impacted (and griefed) by a single observer.

Recommended mitigation steps

Re-consider the trust model of the MsgAddToInTxTracker and MsgAddToOutTxTracker messages and possibly also require a Merkle proof from observers.

lumtis (ZetaChain) confirmed


The original report as published on Code4rena, by berndartmueller. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The tracker messages accept observer-submitted transactions without requiring a Merkle proof to verify their validity.

Impact

A single malicious observer could halt outbound cross-chain transactions and potentially drain funds by forging deposit or sent events.

What the attacker needed

Be an observer on ZetaChain

The fix

The trust model of the tracker messages should be reconsidered, possibly by requiring a Merkle proof from observers.

How it was found

  1. An observer sends a MsgAddToInTxTracker message with a non-existent transaction hash.
  2. The zetaclient errors while processing the suggestion and stops the current loop iteration.
  3. Alternatively, the observer adds an inbound transaction whose recipient is not a desired contract.
  4. Zetaclients vote for the fake transaction, potentially forging Deposit or ZetaSent events.
  5. The observer can also use MsgNonceVoter to mess with external chain nonces, halting outbound cctxs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In this blockchain system, observers are nodes that watch other chains and report transactions. The report says one observer could lie about transactions without proof, which might make the system stop working or lose money.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by berndartmueller

View all

97 more disclosed reports, best first.

More from ZetaChain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.