NOTE: Similar to Ask 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 an ASK order.
Supposing a 1-1 token-point ratio:
If the BID offer has more points than the collateral this will result in user losing their funds
If the BID offer has less points than the collateral this can be used to drain the pool
Alice creates a BID offer for 1000 points and 2000 collateral
Bob creates an ASK order to sell 500 points
Alice settles 500 points on Bob order
Alice closes the bid
Alice is credited with 500 point token
Alice withdraws, but she receives 500 collateral token instead of 500 point token (in this case she 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#L387
Poc, run forge test --via-ir --match-test test_h3_bid_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 settleAskTaker
:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/DeliveryPlace.sol#L387
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
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.