Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: high
Valid

The `depositAmount` calculation in the `abortBidTaker()` function is incorrect

Summary

The depositAmount calculation in the abortBidTaker() function is incorrect, as the protocol uses stockInfo.points * preOfferInfo.points / preOfferInfo.amount.

Vulnerability Details

In the abortBidTaker() function, the protocol incorrectly calculates depositAmount using stockInfo.points * preOfferInfo.points / preOfferInfo.amount. This calculation will result in 0, preventing the user from aborting the bid taker.

uint256 depositAmount = stockInfo.points.mulDiv(
preOfferInfo.points,
preOfferInfo.amount,
Math.Rounding.Floor
);

Impact

The user cannot abort the bid taker.

Tools Used

Recommendations

The recommended fix is to calculate depositAmount using depositAmount = preOfferInfo.amount * stockInfo.points / preOfferInfo.points.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-PreMarkets-abortBidTaker-amount-wrong-StockInfo-points

Valid high severity, due to incorrect computation of `depositAmount` within `abortBidTaker`, when aborting bid offers created by takers, the collateral refund will be completely wrong for the taker, and depending on the difference between the value of `points` and `amount`, it can possibly even round down to zero, causing definite loss of funds. If not, if points were worth less than the collateral, this could instead be used to drain the CapitalPool contract instead.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.