The listOffer
function is used to list Bid
stock type using custom collateral rate in protected
mode settlement type. When user tries to list the offer using different collateral rate compared to the collateral rate set by pre-offer of the stock, the function fetches wrong deposit amount based on previous collateral rate.
The listOffer
function is currently fetching an incorrect deposit amount due to the use of the wrong collateral rate. This issue arises in the context of offers with a Protected
settlement type. The function uses OfferLibraries.getDepositAmount
to calculate the deposit, but the collateral rate provided to this function is incorrect. It uses the collateral rate of pre-offer instead of using the collateral rate of what the user is listing the offer with.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L345-L362
Due to the above issue, if the taker
is listing the offer with higher collateral rate, the offerInfoMap
will list the offer with higher collateral rate but collateral taken from taker
will be less than what needs to be taken. So, the user
who will be buying points from this listed
offer will have wrong impression that the offer have higher collateral deposited. If the taker then doesn't settle the offer
, the buyer of points would be able to seize all the taker's collateral by calling closeBidTaker
which will be determined at higher collateral rate but collateral deposited by the taker
would be less. This will lead to loss of funds for the protocol.
Manual review
Fix the following in listOffer
function:
Valid high severity, because the collateral rate utilized when creating an offer is stale and retrieved from a previously set collateral rate, it allows possible manipilation of refund amounts using an inflated collateral rate to drain funds from the CapitalPool contract
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.