Skip to content
DoS Audit finding Intermediate

Observer Can Temporarily Halt Chain

A single observer being slashed automatically disables inbound transactions and restarts the key generation process, which halts the chain until several manual steps are completed. An attacker who can cause an observer to be slashed could therefore temporarily stop the chain.

ChristiansWhoHack Follow

Originally disclosed on Code4rena

Submitted by ChristiansWhoHack

https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/observer/keeper/hooks.go#L92

The process for changing the TSS address happens as follows:

  1. Observer is either added or slashed. This disables inbound calls and starts the kegen process.
  2. All TSS key holders vote on the TSS key. NOTE: this must be done by manually running a script or restarting the node.
  3. Each TSS key holders votes on the new public key to Zetachain.
  4. The admin calls MigrateFSSFunds to the new key. NOTE: this must be done MANUALLY by the admin.
  5. The TSS address must be updated on the connector and ERC20Custody contracts on all of the chains. NOTE: this must be done MANUALLY by the admin.
  6. Inbound transactions must be turned on again. NOTE: this must be done MANUALLY by the admin.

If a single observer gets slashed for any reason, the chain will be halted until steps 2-6 are manually done. Within the endblocker, we can see the code that will disable inbound CCTXs and restart the keygen process if the observer count is mismatched. This happens within the BeginBlocker process of the observer module.

	if totalObserverCountCurrentBlock == int(lastBlockObserverCount.Count) {
		return
	}

           ...

	k.DisableInboundOnly(ctx)
	k.SetKeygen(ctx, types.Keygen{BlockNumber: math.MaxInt64})

The count changes only when slashing occurs. The slashing happens automatically using the StakingHooks. Within the hook BeforeValidatorSlashed(), it checks to see if the user is underneath the specified threshold. If that’s true, then they will be removed.

	for _, mapper := range mappers {
               ...
		if  sdk.NewDecFromInt(resultingTokens).LT(obsParams.MinObserverDelegation) {
			mapper.ObserverList = CleanAddressList(mapper.ObserverList, accAddress.String())
			k.SetObserverMapper(ctx, mapper)
		}
	}

From the code above, it is clear that an observer going off line from slashing will restart the keygen process and halt the chain. This may happen on accident, such as the server going down from a power outage, or on purpose from a malicious validator.

Considering this requires all TSS voters to perform operations (currently 11 on Ethereum) and the administrator, there are a lot of points of failure here. If this happens, I would guess it would take 12 hours to get everything back into a working state. For a fairly common occurrence, this is a large amount of downtime.

Remediation

One strategy would to simply remove the observer and keep moving on until a pre-determined date. Since the threshold for all of the keys is 2 out of 3, everyone would keep functioning normally until the change was made.

An additional strategy would be to automate this entire process. However, many of these operations are super sensitive, such as migrating admin keys. So, this may be intentional.

lumtis (ZetaChain) confirmed


The original report as published on Code4rena, by ChristiansWhoHack. 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

Likely the design ties the observer count change to an automatic halt and keygen restart, without a grace period or automated recovery.

Impact

A single slashed observer could halt the chain for an estimated 12 hours, causing significant downtime.

What the attacker needed

An observer is slashed; manual steps by TSS holders and admin

The fix

The report suggests either removing the observer without halting until a pre-determined date, or automating the entire recovery process.

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.

A blockchain network relies on a group of validators (observers) to process transactions. If one of these observers is removed (slashed) for misbehaving, the system automatically stops accepting new incoming transactions and requires a manual restart process. This means a single removal can freeze the whole chain for hours.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by ChristiansWhoHack

View all

6 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.