Skip to content
DoS Audit finding Intermediate

Attacker can slow down / halt the chain by queuing multiple stake removals or delegate stake removals

imsrybr0 Follow with pks_

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-06-allora-judging/issues/56

Found by

imsrybr0, pks_

Summary

Attacker can slow down / halt the chain by queuing multiple stake removals or delegate stake removals.

Vulnerability Detail

All stake removals and delegate stake removals for a given block are processed in the EndBlocker in a loop.

Since there is no minimum restriction on the stake amount, an attacker can either :

  • Depending on the registration fee, register multiple reputers, add a 1 uallo stake to each one of them and then cancel his stakes for each one of them.
  • Delegate stake 1 uallo from multiple addresses to each registered reputer then cancel all of them.

Impact

Slow down / halt the chain.

Code Snippet

EndBlocker

GOLANG
func EndBlocker(ctx context.Context, am AppModule) error {
	sdkCtx := sdk.UnwrapSDKContext(ctx)
	blockHeight := sdkCtx.BlockHeight()
	sdkCtx.Logger().Debug(
		fmt.Sprintf("\n ---------------- Emissions EndBlock %d ------------------- \n",
			blockHeight))

	// Remove Stakers that have been wanting to unstake this block. They no longer get paid rewards
	RemoveStakes(sdkCtx, blockHeight, am.keeper) // <===== Audit
	RemoveDelegateStakes(sdkCtx, blockHeight, am.keeper) // <===== Audit

	// ...
}

RemoveStakes

GOLANG
func RemoveStakes(
	sdkCtx sdk.Context,
	currentBlock int64,
	k emissionskeeper.Keeper,
) {
	removals, err := k.GetStakeRemovalsForBlock(sdkCtx, currentBlock)  // <===== Audit
	if err != nil {
		sdkCtx.Logger().Error(fmt.Sprintf(
			"Unable to get stake removals for block %d, skipping removing stakes: %v",
			currentBlock,
			err,
		))
		return
	}
	for _, stakeRemoval := range removals {  // <===== Audit
		// ...
	}
}

RemoveDelegateStakes

GOLANG
func RemoveDelegateStakes(
	sdkCtx sdk.Context,
	currentBlock int64,
	k emissionskeeper.Keeper,
) {
	removals, err := k.GetDelegateStakeRemovalsForBlock(sdkCtx, currentBlock)  // <===== Audit
	if err != nil {
		sdkCtx.Logger().Error(
			fmt.Sprintf(
				"Unable to get stake removals for block %d, skipping removing stakes: %v",
				currentBlock,
				err,
			))
		return
	}
	for _, stakeRemoval := range removals {  // <===== Audit
		// ...
	}
}

Tool used

Manual Review

Recommendation

Process stake removals and delegate stake removals that reached maturity in batches with a predefined size over multiple blocks.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/allora-network/allora-chain/pull/469

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

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

What is known

A high-severity doS bug in Allora. Sherlock made it public on 10 August 2024. Found in the 454 audit contest (finding H-8), also found by 1 other warden.

About DoS

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

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

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 imsrybr0

View all

12 more disclosed reports, best first.

More from Allora

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.