StabilizerNode
Will Mint An Incentive For Triggering An Auction Even If An Auction Exists Already
#191
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
leastwood
Vulnerability details
Impact
_startAuction
utilises theSwingTrader
contract to purchase Malt. IfSwingTrader
has insufficient capital to return the price of Malt back to its target price, an auction is triggered with the remaining amount. However, no auction is triggered if the current auction exists, butmsg.sender
is still rewarded for their call tostabilize
.Proof of Concept
_shouldAdjustSupply
initially checks if the current auction is active, however, it does not check if the current auction exists. There is a key distinction between theauctionActive
andauctionExists
functions which are not used consistently. Hence, an auction which is inactive but exists would satisfy the edge case and result intriggerAuction
simply returning.https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/Auction.sol#L382-L386
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/Auction.sol#L268-L272
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/StabilizerNode.sol#L342-L344
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/Auction.sol#L873-L888
Tools Used
Manual code review.
Recommended Mitigation Steps
Consider using
auctionExists
andauctionActive
consistently inStabilizerNode
andAuction
to ensure this edge case cannot be abused.The text was updated successfully, but these errors were encountered: