Resolver is not initialized in the protocol’s keeper
The custom denom resolver in the feemarket keeper was not initialised, so the skip-mev ante handler used its own default conversion instead of the protocol's multi-denom logic. This meant the new multi-denom fee feature could not be used.
ABAIKUNANBAEV Follow with ABAIKUNANBAEV and zhaojie
Originally disclosed on Code4rena
Submitted by ABAIKUNANBAEV, also found by ABAIKUNANBAEV and zhaojie
Finding description and impact
At the moment, resolver is not initialized in the feemarket/keeper resulting in a situation where ante from the skip-mev would use its own ConvertToDenom() and not the one initialized in the Mantra protocol.
Proof of Concept
Mantra chain currently uses its own implementation of the ConvertToDenom() function:
https://github.com/code-423n4/2024-11-mantra/blob/main/x/xfeemarket/keeper/resolver.go#L11-23
func (k Keeper) ConvertToDenom(ctx sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error) {
if coin.Denom == denom {
return coin, nil
}
multiplier, err := k.DenomMultipliers.Get(ctx, denom)
if err != nil {
return sdk.DecCoin{}, err
}
amount := coin.Amount.Mul(multiplier.Dec)
return sdk.NewDecCoinFromDec(denom, amount), nil
}
The problem is that it’s not initialized in the Keeper struct:
https://github.com/code-423n4/2024-11-mantra/blob/main/x/xfeemarket/keeper/keeper.go#L14-30
type (
Keeper struct {
cdc codec.BinaryCodec
storeService store.KVStoreService
logger log.Logger
bankkeeper types.BankKeeper
// the address capable of executing a MsgUpdateParams message.
// Typically, this should be the x/gov module account.
authority string
Schema collections.Schema
Params collections.Item[types.Params]
// DenomMultipliers is a map of denomination and their multipliers against the default base fee denomination.
DenomMultipliers collections.Map[string, sdk.DecProto]
}
Therefore, when ante decorator from the skip-mev would have to use the resolver, it would use its own one instead of the one implemented in the protocol:
https://github.com/skip-mev/feemarket/blob/main/x/feemarket/keeper/keeper.go#L28-49
// NewKeeper constructs a new feemarket keeper.
func NewKeeper(
cdc codec.BinaryCodec,
storeKey storetypes.StoreKey,
authKeeper types.AccountKeeper,
resolver types.DenomResolver,
authority string,
) *Keeper {
if _, err := sdk.AccAddressFromBech32(authority); err != nil {
panic(fmt.Sprintf("invalid authority address: %s", authority))
}
k := &Keeper{
cdc: cdc,
storeKey: storeKey,
ak: authKeeper,
resolver: resolver,
authority: authority,
}
return k
}
This creates a scenario where protocol’s newly implemented functionality for denom conversions to support multiple coin fee market cannot be used.
Recommended mitigation steps
Initialize the resolver in the feemarket/keeper.go.
Looks valid.
Lance Lan (MANTRA) disputed and commented:
xfeemarket keeper and resolver is not wired in as we only plan on using it in the future once we move to support multi fee denom.
Closing as intended behavior / insufficient proof it shouldn’t be.
ABAIKUNANBAEV (warden) commented:
Similar to H-04, if that is considered a valid issue, this one should also be reconsidered and given a medium severity.
Per audit README, multi-token fee support is to be audited, meaning all the issues regarding it should be taken into account.
More than H-04, I consider this finding closer to M-03, so a similar sort seems reasonable.
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 keeper struct did not include a resolver field, so the custom resolver was never wired into the skip-mev ante handler.
Impact
The protocol's multi-denom fee conversion could not be used, but the project stated this was intended until future support is added.
What the attacker needed
None
The fix
The resolver should be initialised in the feemarket keeper so the custom conversion logic is used.
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 resolver is a piece of code that converts between different coin denominations. The protocol wrote its own resolver but forgot to plug it into the keeper, so the system kept using the default one. As a result, the new multi-coin fee feature simply did not work.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.