Bypass or reduction on the lockup period of Pool FDTs.
Maple Finance contest
Originally disclosed on Code4rena
In Pool.sol, the lockup restriction of withdrawal (Pool.sol#396) can be bypassed or reduced if new liquidity providers cooperate with existing ones.
- A liquidity provider, Alice, deposits liquidity assets into the pool and minted some FDTs. She then waits for
lockupPerioddays and callsintendToWithdrawto pass her withdrawal window. Now she is available to receive FDTs from others. - A new liquidity provider, Bob, deposits liquidity assets into the pool and minted some FDTs. Currently, he is not allowed to withdraw his funds by protocol design.
- Bob and Alice agree to cooperate with each other to reduce Bob’s waiting time for withdrawal. Bob transfers his FDT to Alice via the
_transferfunction. - Alice calls
intendToWithdrawand waits for thewithdrawCooldownperiod. Notice that Alice’sdepositDateis updated after the transfer; however, since it is calculated using a weighted timestamp, the increased amount of lockup time should be less thanlockupPeriod. In situations where the deposit from Alice is much larger than that from Bob, Alice could only even need to wait for thewithdrawCooldownperiod before she could withdraw any funds. - Alice then withdraws the amount of FDT that Bob transferred to her and transfers the funds (liquidity assets) to Bob. Bob successfully reduces (or bypasses) the lockup period of withdrawal.
Recommend forcing users to wait for the lockup period when transferring FDT to others or let the depositDate variable record the timestamp of the last operation instead of a weighted timestamp.
lucas-manuel (Maple) confirmed:
Addressed in this PR
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Maple Finance contest. Code4rena made it public on 3 May 2021. Found in the 2021-04-maple audit contest (finding M-03).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.