If an ask maker (who is not the origin) in turbo mode, calls the settleAskMaker function. He is refunded amount x collateral. But as it is turbo mode he had never deposited this amount.
Assume the following scenario:
Bob creates an ask offer in turbo mode of 100 points for amount = 100USDC with collateral = 20,000
Therefore Bob deposits 200USDC.
Alice calls the createTaker
function, and deposits 100USDC + tax + platformFee
Alice creates an offer with amount = 200USDC, collateral remains the same as it is turbo mode
Note that Alice doesnt have to deposit any collateral as it is turbo mode.
https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L335-L343
Now the marketplace goes into the asksettling phase, and alice calls the settleAskMaker function and pays 0, since the used_points = 0.
Here since there is no check for turbo mode, Alice is refunded 200 x 200%( amount x collateral) = 400USDC
Clearly Alice should have been refunded 0, but she is being given 400USDC.
Note: Alice can use much larger amounts to increase her earnings.
The attacker (Alice) can drain the entire funds of the contract by setting a very large amount.
Manual Review
Add a check in the settleAskMaker function for turbo mode as follows (line 274 DeliveryPlace.sol):
Valid high severity, this allows resellers listing offers via `listOffer/relistOffer` to game the system. Based on the inherent design of Turbo mode not requiring takers making ask offers for the original maker offer to deposit collateral, the wrong refund of collateral to takers even when they did not deposit collateral due to turbo mode during settleAskMaker allows possible draining of pools.
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.