NOTE: Similar to Bid offers result in withdrawal of collateral instead of point token
but with a different root cause.
They are different issues with a different mitigation, and BOTH must be fixed.
Users receive the wrong kind of token after closing a BID order.
Supposing a 1-1 token-point ratio:
If the ASK offer has more points than the collateral this will result in user losing their funds
If the ASK offer has less points than the collateral this can be used to drain the pool
Alice creates an ASK offer for 1000 points and 2000 collateral
Bob creates a BID order to buy 500 points, sending 1000 as payment
Alice settles 500 points on Bob order
Bob closes the bid
Bob is credited with 500 point token
Bob withdraws, but he receives 500 collateral token instead of 500 point token (in this case he lost 500 collateral token)
If offer points were higher than collateral, this can be leveraged to drain the pool instead
Point token address should be used here, not the maker token address:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/DeliveryPlace.sol#L198
Poc, run forge test --via-ir --match-test test_h2_ask_point_withdrawals_is_collateral -vv
Impact: High (Protocol funds drained or high loss of user funds)
Likelihood: High (anyone can do it without pre-conditions)
Risk: Critical
Manual Review
In DeliveryPlace
, change closeBidTaker
:
Valid high severity, In `settleAskTaker/closeBidTaker`, by assigning collateral token to user balance instead of point token, if collateral token is worth more than point, this can cause stealing of other users collateral tokens within the CapitalPool contract, If the opposite occurs, user loses funds based on the points they are supposed to receive
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.