There is a missing validation in the PreMarkets.abortBidTaker()
function that fails to check whether the offer is actually a Bid
offer. Without this check, a user can call this function with their Bid
stock of an Ask
offer, which can lead to funds being locked if the collateral ratio is greater than 100%.
There are other issues that, when fixed, will reveal additional problems in the PreMarkets.abortBidTaker()
function.
The issue with overinflated maker refund when collateral ratio is > 100%
in the PreMarkets.abortAskOffer()
function is fixed. This issue was reported separately. Assume the function is working as expected.
The issue with incorrect depositAmount calculation
in the PreMarkets.abortBidTaker()
function is fixed. This issue was reported separately. Assume the calculation of the depositAmount
value works as expected.
Given the above preconditions, consider the following scenario:
The maker creates an Ask
offer for 50 points for 50 USDC, with a 200% collateral ratio, and deposits 100 USDC as collateral.
The taker accepts this Ask
offer for 25 points for 25 USDC.
The maker aborts the Ask
offer, retrieving 50 USDC of collateral and leaving 50 USDC as compensation for the taker.
The taker can now call PreMarkets.abortBidTaker()
. Since the function does not check if the offer is a Bid
offer, the taker can mistakenly call this function. The calculations for the transferAmount
do not account for the collateral ratio, so the taker receives only 25 USDC. An additional 25 USDC that were used as collateral are locked in the contract and lost.
Although it is user error to call PreMarkets.abortBidTaker()
instead of DeliveryPlace.closeBidTaker()
(which would correctly refund 50 USDC), the end result is that the user loses funds, and they are locked in the system.
Funds are locked.
Manual review.
Add validation in the PreMarkets.abortBidTaker()
function to ensure the offer is a Bid
offer before proceeding with execution.
Low severity, the check is indeed missing for `abortBidTaker`, however, this would be contingent on user error and the funds are not locked, given admin can rescue them via `Rescuable.sol`
Leaving high severity for now but will leave open for appeals. Technically, users can choose not to transact this type offers if they are aware of such undercollaterized relisted offers, in which case it will have no impact. However, if subsequent takers transact this relisted offers, this can allow profits without having to settle any points.
Low severity, the check is indeed missing for `abortBidTaker`, however, this would be contingent on user error and the funds are not locked, given admin can rescue them via `Rescuable.sol`
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.