Skip to content

Code4rena

Malt Protocol - Versus contest

Every publicly disclosed report for Malt Protocol - Versus contest and what kind of bugs they were.

disclosed reports
57
most reported class
Business logic
bug classes found
5
first disclosure
2022
Find Malt Protocol - Versus contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Malt Protocol - Versus contest chose to make public.

Business logic

Manipulation of livePrice to receive defaultIncentive in 2 consecutive blocks

The swing trader trigger validation relies on a manipulable live price, allowing an attacker to claim the default incentive in two consecutive blocks. The attacker could use a flash loan or sandwich attack to manipulate the price and receive the incentive again.

Malt Protocol - Versus contest

High
Business logic

SwingTraderManager.swingTraders() shoudn’t contain duplicate traderContract s.

The addSwingTrader function does not check that each traderContract is unique, so the same contract can be registered under multiple trader IDs. This causes functions like buyMalt and sellMalt to distribute shares incorrectly because they rely on trader balances.

Malt Protocol - Versus contest

Medium
Smart contracts

The latest malt price can be less than the actual price target and StabilizerNode.stabilize will revert

In the StabilizerNode contract, the minimum price threshold is computed by subtracting a slippage amount from the latest price sample, which assumes the latest sample is at least the price target. When the latest sample is below the target, the subtraction underflows and the stabilize call reverts with an arithmetic error rather than a clear message.

Malt Protocol - Versus contest

Medium
Business logic

StabilizerNode.stabilize uses stale GlobalImpliedCollateralService data, which will make stabilize incorrect

The stabilize function reads stale collateral ratio data because it does not refresh the global implied collateral service before using it for price calculations. An attacker could manipulate the collateral ratio by moving funds out of the swing trader, causing stabilize to use incorrect data and potentially depeg the malt token.

Malt Protocol - Versus contest

High
Smart contracts

LinearDistributor.declareReward() might revert after changing vestingDistributor .

The reward declaration function subtracts a stored previous vested amount from the current vested amount of the vesting distributor, but the admin can swap the distributor without resetting that stored value. If the new distributor reports a smaller vested amount, the subtraction underflows and the reward declaration reverts, blocking rewards until the admin restores the old distributor.

Malt Protocol - Versus contest

Medium
Business logic

StabilizerNode.stabilize may use undistributed rewards in the overflowPool as collateral

The stabilize function calculates the collateral ratio using global collateral that includes undistributed rewards sitting in the overflow pool, so the ratio can be overstated. An attacker could not directly exploit this, but the incorrect ratio could lead to wrong price targets and destabilise the peg.

Malt Protocol - Versus contest

Medium
Business logic

LinearDistributor.declareReward: previouslyVested may update incorrectly, which will cause some rewards to be lost

In LinearDistributor.declareReward, when the calculated reward exceeds the contract's balance, the distributed amount is capped at the balance, but previouslyVested is still advanced to the full currentlyVested value. As a result, the rewards that could not be paid out are skipped and lost in subsequent distributions.

Malt Protocol - Versus contest

Medium
DoS

LinearDistributor.declareReward can revert due to dependency of balance

The declareReward function in LinearDistributor can revert if the contract's collateral token balance exceeds the buffer requirement, because the forfeit logic requires the excess to be no more than the declared balance. An attacker can send collateral tokens to the contract to trigger this revert, potentially causing a permanent denial of service if enough tokens are sent to cover all vested rewards.

Malt Protocol - Versus contest

Medium
Access control

MaltRepository._revokeRole may not work correctly

MaltRepository overrides hasRole to also require validRoles[role], so once a role is removed via removeRole, _revokeRole silently fails to revoke it from an account. An attacker holding a removed role could keep it, and _transferRole would grant the role to a new account without removing it from the old one.

Malt Protocol - Versus contest

Medium
Race condition

RewardThrottle.populateFromPreviousThrottle may be exposed to front-run attack

The admin-only function that copies epoch data from a previous throttle contract can be front-run by any user calling the public gap-filling function, which advances the active epoch first. This could cause the admin's population call to be invalidated or to write state for future epochs.

Malt Protocol - Versus contest

Medium
Business logic

RewardThrottle.setTimekeeper: If changing the timekeeper causes the epoch to change, it will mess up the system

The setTimekeeper function lets a privileged role swap the timekeeper contract while the reward throttle is active, and if the new timekeeper reports a different epoch number the reward accounting breaks. An attacker with that role could raise the epoch and then claim a large batch of rewards, or lower it and block rewards for the current epoch.

Malt Protocol - Versus contest

Medium
Business logic

Repository._removeContract() removes the contract wrongly.

The _removeContract function in Repository.sol resets the contract's index to zero before using it to update the contracts array, so it always replaces the first element with the last and leaves the removed name in the array. This corrupts the list of contract names, causing valid contracts to be removed and the removed contract to remain.

Malt Protocol - Versus contest

Medium
DoS

RewardThrottle._sendToDistributor() reverts if one distributor is inactive.

The reward distribution function transfers tokens to each distributor and then calls declareReward, which reverts if any distributor is inactive. An attacker could not directly exploit this, but an inactive distributor would cause the entire reward distribution to fail, blocking rewards for all active distributors.

Malt Protocol - Versus contest

Medium
Business logic

Average APR s might be calculated wrongly after calling populateFromPreviousThrottle() .

The admin function populateFromPreviousThrottle() copies epoch data from a previous throttle contract and advances activeEpoch, but if the new epoch is less than the smoothing period ahead of the old one, the average APR calculation mixes cumulative values from different epochs. This could cause targetAPR to be adjusted incorrectly.

Malt Protocol - Versus contest

Medium
Business logic

StabilizerNode.stabilize() should update lastTracking as well to avoid an unnecessary incentive.

The stabilize() function refreshes pool tracking data but does not update the lastTracking timestamp, so the separate trackPool() function can still pay its tracking incentive immediately afterwards. An attacker could repeatedly call stabilize() and then trackPool() to collect incentives more often than intended.

Malt Protocol - Versus contest

Medium
Business logic

priceTarget is inconsistent in StabilizerNode.stabilize

The stabilize function uses a different price target than the early check that decides whether to adjust supply, so when stabilizing to peg it can choose to run an auction instead of selling malt, or the reverse. This inconsistency could lead to the wrong stabilisation action being taken.

Malt Protocol - Versus contest

Medium
Business logic

_distributeProfit will use the stale globalIC.swingTraderCollateralDeficit()/swingTraderCollateralRatio() , which will result in incorrect profit distribution

The profit distribution function reads stale collateral deficit and ratio values from globalIC because the contract does not synchronise globalIC before calling handleProfit. This causes the swing trader's collateral to be understated, making the deficit appear larger and leading to an incorrect split of profits between liquidity providers and the swing trader.

Malt Protocol - Versus contest

High
Business logic

theft of system profit

The stabilisation mechanism that should return the Malt token price to its peg can be sandwiched by anyone, allowing them to extract profit that would otherwise go to investors. An attacker can use a flash loan to sell Malt at a high price, call stabilize to push the price down, then buy back Malt cheaply and repay the loan, keeping the difference.

Malt Protocol - Versus contest

Medium
Smart contracts

AbstractRewardMine.sol#setRewardToken is dangerous

The setRewardToken function allows an admin to change the reward token, which resets totalDeclaredReward to zero but leaves accumulated padding variables unchanged, causing accounting inconsistencies. An attacker with admin privileges could exploit this to disrupt reward distribution.

Malt Protocol - Versus contest

Medium
Business logic

_notSameBlock() can be circumvented in bondToAccount()

The bondToAccount() function uses a per-address same-block check that can be bypassed by calling through an intermediary smart contract, because the check keys on msg.sender. An attacker could therefore perform multiple actions in the same block that the protocol intended to prevent.

Malt Protocol - Versus contest

Medium
Smart contracts

AbstractRewardMine - Re-entrancy attack during withdrawal

The internal withdrawal function updated its accounting after transferring the reward token, so a token with transfer hooks could re-enter the withdrawal and drain the pool. An attacker using such a token could repeatedly withdraw before the recorded amount was updated.

Malt Protocol - Versus contest

Medium
Business logic

_getFirstSample returns wrong sample if count < sampleMemory

The `_getFirstSample` helper in a moving-average contract computed the first sample index as if the ring buffer had already wrapped, so before the buffer filled it pointed at a zero-initialised slot instead of index zero. This produced an incorrect time-weighted average price, which the sponsor said could leak value but did not put funds directly at risk.

Malt Protocol - Versus contest

Medium
Business logic

AuctionParticipant.sol: purchaseArbitrageTokens should not push duplicate auctions

The purchaseArbitrageTokens function appends the current auction ID to an array every time it is called, so calling it multiple times for the same auction creates duplicate entries. This can cause the claim function to mishandle the replenishingIndex, potentially preventing participants from claiming rewards without manual intervention.

Malt Protocol - Versus contest

Medium
Business logic

Frontrunning in UniswapHandler calls to UniswapV2Router

The UniswapHandler contract calls UniswapV2Router methods for swapping and removing liquidity without setting a minimum output amount, passing zero instead. An attacker can watch the mempool and sandwich these transactions to profit from the guaranteed trade.

Malt Protocol - Versus contest

Medium
Business logic

Dutch auction can be manipulated

The Dutch auction for arbitrage tokens can be manipulated by purchasing all but one wei of the maximum commitments, preventing the auction from ending early and forcing it to continue until the price drops to the midpoint between start and end. An attacker can thus guarantee a purchase at a lower price.

Malt Protocol - Versus contest

Medium