Closed code423n4 closed 2 years ago
while this could technically happen, it should be up to the auction rebalancer to make sure they can actually settle the auction whether that's how much capital is required, and possible issues with the new weights. i would consider this a low risk issue.
I agree, I think it is expected that the auction rebalancer will check minIbRatio
before calling bondForRebalance()
. However, I actually think this is a duplicate of #53 as it also describes how an auction rebalancer can have their tokens burnt by a malicious publisher.
Handle
WatchPug
Vulnerability details
According to the
newRatio
formula insettleAuction()
, the maximum value ofnewRatio
isfactory.auctionMultiplier() * basket.ibRatio()
.However, since there is no validation for the value of
minIbRatio
when setting it, if the publisher publishes a newIndex withminIbRatio
larger thanfactory.auctionMultiplier() * basket.ibRatio()
,settleAuction()
will always fail.https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Auction.sol#L97-L99
https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Basket.sol#L216-L244
PoC
bondPercentDiv
= 400basketToken.totalSupply
= 40,000factory.auctionMultiplier
= 2factory.auctionDecrement
= 10,000basket.ibRatio
= 1e18publishNewIndex()
with_minIbRatio
=2e18
bondForRebalance()
just after 1 block, paid100
basketTokensettleAuction()
, it will always fail becausenewRatio < minIbRatio
bondBurn()
after 24 hrs, and Alice's100
basketToken will be burned.Recommendation
Change to: