Hunt prep
Before you test Malt Protocol - Versus contest
What 57 disclosed reports say about Malt Protocol - Versus contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing 15
Ideas drawn from this program's disclosed reports and our class lessons. None of them is a known bug: each is a place to look, and the reports linked under it are why. Check the current scope before testing anything.
-
1
Test role revocation when a role has been removed from the valid set
Access control Read the lesson
The repository override of hasRole means revocation can silently skip accounts once a role is removed. Test every path that grants, transfers and revokes roles, including _transferRole, to see whether an account keeps a removed role or a new holder is added without the old one losing it. This builds on the reported revocation flaw.
From the lessons: Grant a migration permit to a migrator, have an admin revoke the migra...; After a stale permit survives a role revocation, re-grant the migrator...; After the role is re-granted to the same address, the stored permit be...
-
2
Check reward accounting when a distributor is swapped or capped
Business logic Read the lesson
LinearDistributor advances previouslyVested even when the payout is capped by balance, and the setter for the vesting distributor leaves stored values untouched. Test declareReward after a distributor swap and after a balance-capped payout to see whether unpaid rewards are carried forward or lost, and whether the subtraction underflows.
Backed byLinearDistributor.declareReward: previouslyVested may update inc... (2023) LinearDistributor.declareReward() might revert after changing ve... (2023) LinearDistributor.declareReward can revert due to dependency of... (2023)From the lessons: Staking contracts with reward indexes, vesting periods, native reward...; Reward claiming and unstaking on a staking and delegation contract.
-
3
Probe epoch advancement races around admin population calls
Business logic Read the lesson
populateFromPreviousThrottle can be front-run by the public gap-filling function, and setTimekeeper can shift the epoch under the throttle. Test the ordering of these admin and public calls, including calling the gap filler first, to see whether epoch state is written for the wrong epoch or rewards are skipped.
Backed byRewardThrottle.populateFromPreviousThrottle may be exposed to fr... (2023) RewardThrottle.setTimekeeper: If changing the timekeeper causes... (2023) Average APR s might be calculated wrongly after calling populate... (2023)From the lessons: Batch order execution reusing a cached price basket, including across...; Commit two orders a few seconds apart, build a signed price payload wh...
-
4
Test cumulative price subtraction across the Uniswap wrap boundary
MaltDataLab subtracts a stored cumulative price from a Uniswap V2 value that is designed to overflow, without an unchecked block. Test trackPool and stabilize around the wrap point and with a freshly reset stored value to see whether the subtraction reverts and blocks stabilisation.
From the lessons: Price feeds, pool share weights and Curve or Balancer pool oracles use...; Check whether the oracle can return a stale price or a deprecated pool...
-
5
Check stale collateral data used by stabilize and profit distribution
Business logic Read the lesson
Several reports show stabilize and _distributeProfit reading globalIC before syncing it, and using undistributed overflow pool rewards as collateral. Test the order of syncGlobalCollateral, delegateCapital, sellMalt and handleProfit to see whether price targets and profit splits use stale ratios.
Backed byStabilizerNode.stabilize uses stale GlobalImpliedCollateralServi... (2023) _distributeProfit will use the stale globalIC.swingTraderCollate... (2023) StabilizerNode.stabilize may use undistributed rewards in the ov... (2023)From the lessons: Owner recapitalisation and reconcile functions, including the path for...; Recapitalisation, reconcile and high-water mark logic for Senior and J...
-
6
Look for duplicate or inactive trader entries in swing trader accounting
Business logic Read the lesson
addSwingTrader pushes to activeTraders regardless of the active flag and does not check for duplicate trader contracts. Test adding the same contract twice, adding inactive traders and toggling them, then check whether balance and share calculations count a trader more than once.
Backed bySwingTraderManager.addSwingTrader will push traderId with active... (2023) SwingTraderManager.swingTraders() shoudn’t contain duplicate tra... (2023)From the lessons: Voting escrow, voter, bribe, revenue handler, rewards distributor and...; Batched yield distribution, raffle prize pools and spin reward contrac...
-
7
Test incentive claims across consecutive blocks via price manipulation
Business logic Read the lesson
The swing trader trigger uses a manipulable live price, and stabilize does not update lastTracking, so incentives may be claimed more often than intended. Test calling stabilize then trackPool in the same and adjacent blocks, and check whether the default incentive can be collected twice.
Backed byManipulation of livePrice to receive defaultIncentive in 2 conse... (2023) StabilizerNode.stabilize() should update lastTracking as well to... (2023) Malt Protocol Uses Stale Results From MaltDataLab Which Can Be A... (2022)From the lessons: Voting escrow, voter, bribe, revenue handler, rewards distributor and...; Reward claiming and unstaking on a staking and delegation contract.
-
8
Check price target selection and slippage underflow in stabilize
Business logic Read the lesson
stabilize uses a different price target than the early supply check, and the minimum threshold subtracts slippage from a sample that may be below target. Test stabilizeToPeg both ways and with a latest sample below the target to see whether the wrong action runs or the call reverts.
Backed bypriceTarget is inconsistent in StabilizerNode.stabilize (2023) The latest malt price can be less than the actual price target a... (2023)From the lessons: Compare the protocol's computed slippage bound against the true expect...; Set the slippage parameter to a value that passes the check but still...
-
9
Probe residual approvals and fee-on-transfer handling in handlers
Smart contracts Read the lesson
Earlier reports show approvals left set after partial use and assumptions that transferred amounts equal received amounts. Test the Uniswap handler and bonding paths with tokens that charge a fee or return short amounts, and check whether residual allowances accumulate or balance checks revert.
Backed by_distributeRewards Does Not Reset Approval If Not All Tokens Wer... (2022) addLiquidity Does Not Reset Approval If Not All Tokens Were Adde... (2022) Auction collateralToken won’t work if token is fee-on-transfer t... (2022)+1 more report
From the lessons: Test the protocol with several ERC20 variants (different decimals, no...; Use a fee-on-transfer token as the asset or collateral and check wheth...; Call every transfer and transferFrom path with a token that returns fa...
-
10
Test slippage bounds on handler swaps and liquidity removal
Smart contracts Read the lesson
The handler passes zero minimum output to the router, and addLiquidity uses fixed percentages of its own balances. Test swaps, liquidity adds and removals for missing or overly strict bounds, including forcing unbalanced balances by sending tokens to the contract.
Backed byFrontrunning in UniswapHandler calls to UniswapV2Router (2022) Slippage checks when adding liquidity are too strict (2022) Unable to remove liquidity in Recovery Mode (2022)From the lessons: Check whether every swap, deposit or mint path enforces a user-supplie...; Add or decrease liquidity and check whether a minimum amount bound is...; Swap with an incorrect slippage value and check whether the swap can b...
-
11
Check auction state updates in exitEarly and commitment caps
Business logic Read the lesson
exitEarly updates userCommitment and userMaltPurchased inconsistently, and purchaseArbitrageTokens can be called with zero amount after direct transfers. Test repeated early exits and zero-amount purchases to see whether the commitment ratio drifts or the cap is bypassed.
Backed byAuctionEschapeHatch.sol#exitEarly updates state of the auction w... (2022) Users Can Contribute To An Auction Without Directly Committing C... (2022) Dutch auction can be manipulated (2022)From the lessons: NFT lending protocols with isolated and cross modes, auctions and yiel...; The liquidation routine that seizes collateral, deducts a liquidator f...
-
12
Probe same-block restrictions routed through helper contracts
Business logic Read the lesson
The same-block check in bondToAccount keys on msg.sender, so a forwarding contract may bypass it. Test bonding and related actions through intermediary contracts in one block to see whether the intended restriction holds for the real user.
From the lessons: Send concurrent requests that rely on application-level checks and che...; Application-level checks without database constraints
-
13
Test moving average sample memory changes and ring buffer edges
Business logic Read the lesson
setSampleMemory misaligns samples and _getFirstSample returns the wrong slot before the buffer fills. Test changing sample memory while samples exist and reading lookback values before and after the buffer wraps, checking whether the exchange rate used by stabilize is distorted.
Backed byMovingAverage.setSampleMemory() may broke MovingAverage, making... (2022) _getFirstSample returns wrong sample if count < sampleMemory (2022)From the lessons: Call a period-for-timestamp view with a past timestamp, advance chain...; Call the period-at-timestamp view with a past timestamp and with a fut...
-
14
Check reward mine withdrawal ordering and reward token swaps
Smart contracts Read the lesson
The withdrawal path updates accounting after transferring, and setRewardToken leaves padding variables stale. Test re-entry through a token callback during withdrawal and a reward token change followed by claims to see whether balances or declared rewards become inconsistent.
Backed byAbstractRewardMine - Re-entrancy attack during withdrawal (2022) AbstractRewardMine.sol#setRewardToken is dangerous (2022)From the lessons: Functions that make external calls to tokens, native currency or NFTs...; Re-enter a redemption or swap function through a callback and check wh...; Check withdrawal functions for a missing non-reentrancy modifier and r...
-
15
Probe timelock and role bypass paths around admin functions
Access control Read the lesson
The timelock could be bypassed by the governor, reassignGlobalAdmin needs a role the timelock may lack, and setBonding used the wrong role. Test governor-controlled setters, role reassignment and bonding role management to see whether privileged actions can run without the intended delay or role.
Backed byTimelock can be bypassed (2022) Wrong permissions on reassignGlobalAdmin (2022) MiningService.setBonding should use BONDING role instead of REIN... (2022)From the lessons: Have the current admin nominate a pending admin, then have the pending...; Call the pending-admin acceptance function as the nominated pending ad...; Call the accept-ownership function as the pending owner and check whet...
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 36 | 0 | – | – | $0 |
| Access control lesson | 10 | 0 | – | – | $0 |
| Smart contracts lesson | 7 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Race condition lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
LinearDistributor.declareReward: previouslyVested may update incorrectly, which will cause some rewards to be lost
The code should be fixed so that previouslyVested is advanced only by the vested amount corresponding to the actually distributed reward.
Disclosed
-
Value of totalProfit might be wrong because of wrong logic in function sellMalt()
The totalProfit update should be moved before the dust check in sellMalt.
Disclosed
-
The latest malt price can be less than the actual price target and StabilizerNode.stabilize will revert
The team should handle the case where the latest sample is below the price target with an explicit error rather than letting the subtraction underflow.
Disclosed
-
StabilizerNode.stabilize may use undistributed rewards in the overflowPool as collateral
The stabilize function should call checkRewardUnderflow to distribute pending rewards and then sync the global collateral before using the ratio.
Disclosed
-
SwingTraderManager.addSwingTrader will push traderId with active = false to activeTraders
The addSwingTrader function should only push the trader ID to activeTraders if the active flag is true, and set the index accordingly.
Disclosed
-
RewardThrottle.populateFromPreviousThrottle may be exposed to front-run attack
The team said they would remove the fillInEpochGaps method, and the report also recommends calling populateFromPreviousThrottle only during contract setup.
Disclosed
-
Manipulation of livePrice to receive defaultIncentive in 2 consecutive blocks
The protocol should not give incentives to the caller or should reset primedBlock only after primedWindow blocks.
Disclosed
-
SwingTraderManager.swingTraders() shoudn’t contain duplicate traderContract s.
Add a mapping to track active trader contracts and check that a contract is added only once.
Disclosed
-
StabilizerNode.stabilize uses stale GlobalImpliedCollateralService data, which will make stabilize incorrect
Call impliedCollateralService.syncGlobalCollateral() before StabilizerNode.stabilize calls maltDataLab.getActualPriceTarget.
Disclosed
-
LinearDistributor.declareReward() might revert after changing vestingDistributor .
The setter should also update the stored previously vested amount and timestamp, which the project confirmed as a sufficient solution.
Disclosed
-
Function stabilize() might always revert because of overflow since Malt contract use solidity 0.8
The code should use an unchecked block for the overflow-prone subtraction to match Uniswap V2's intentional overflow behaviour.
Disclosed
-
LinearDistributor.declareReward can revert due to dependency of balance
The contract should track the collateral token balance internally and add logic to sweep unused collateral tokens.
Disclosed
-
RewardThrottle: If an epoch does not have any profit, then there may not be rewards for that epoch at the start of the next epoch.
The team said they will remove both implementations of fillInEpochGaps.
Disclosed
-
MaltRepository._revokeRole may not work correctly
Override renounceRole, revokeRole and _transferRole to require that validRoles[role] is true before proceeding.
Disclosed
-
RewardThrottle.setTimekeeper: If changing the timekeeper causes the epoch to change, it will mess up the system
The project said it would remove the setTimekeeper methods entirely, since the timekeeper should never need updating.
Disclosed