Skip to content
Business logic Audit finding Intermediate

Missing export `CoreTeamAddresses` in `x/emissions` module

The ExportGenesis function in the x/emissions module omits the CoreTeamAddresses field from the genesis state. After a chain upgrade, no admin members are restored, blocking all whitelist admin functions such as adding admins or updating module parameters.

404Notfound Follow

Originally disclosed on Sherlock

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

Found by

404Notfound

Summary

The genesis state CoreTeamAddresses is missing when exporting state in x/emissions module

Vulnerability Detail

The genesis state of x/emissions module is defined below: allora-chain/x/emissions/types/genesis.pb.go

Go
type GenesisState struct {
	// params defines all the parameters of the module.
	Params            Params   `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	CoreTeamAddresses []string `protobuf:"bytes,2,rep,name=core_team_addresses,json=coreTeamAddresses,proto3" json:"core_team_addresses,omitempty"`
}

However, when exporting states during a chain upgrade, the CoreTeamAddresses field is missing.

Go
func (k *Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) {
	moduleParams, err := k.GetParams(ctx)
	if err != nil {
		return nil, err
	}

	return &types.GenesisState{
		Params: moduleParams,
	}, nil
}

If the CoreTeamAddresses is missing, no admin member will be added after the chain upgrade. Thus, all the whitelist admin-related functions will be blocked, such as adding a new admin member or updating the module parameters.

Impact

All the whitelist admin-related functions will be blocked, such as adding a new admin member or updating the module parameters.

Code Snippet

https://github.com/sherlock-audit/2024-06-allora/blob/4e1bc73db32873476f8b0a88945815d3978d931c/allora-chain/x/emissions/keeper/genesis.go#L45-L55

Tool used

Manual Review

Recommendation

Adding CoreTeamAddresses when exporting genesis state of x/emissions module

Discussion

relyt29

this is indirectly a duplicate of #43

sherlock-admin2

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

The original report as published on Sherlock, by 404Notfound. 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.

How it worked

Root cause

The ExportGenesis function does not include the CoreTeamAddresses field when constructing the GenesisState, so the admin list is lost during export.

Impact

All whitelist admin-related functions are blocked, including adding new admin members and updating module parameters.

What the attacker needed

Chain upgrade occurs

The fix

The issue was fixed by including CoreTeamAddresses in the exported genesis state.

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.

When a blockchain upgrades, it saves its state and reloads it. This module forgot to save the list of admin addresses, so after the upgrade there are no admins. Without admins, nobody can perform admin actions like adding new admins or changing settings.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 404Notfound

View all

1 more disclosed report, 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.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.