Migration.join() and Migration.leave() can still work after unsucessful migration.
Originally disclosed on Code4rena
Submitted by hansfriese, also found by 0x52 and codexploder
Impact
Migration.join() and Migration.leave() can still work after unsucessful migration. As I submitted with my high-risk finding “Migration.withdrawContribution() might work unexpectedly after unsuccessful migration.”, withdraw logic after unsuccessful migration is different from the initial leave() logic and the withdrawal logic would be messy if users call join() and leave() after unsuccessful migration.
Proof of Concept
According to the explanation, join() and leave() functions must be called for 7 days before commition.
Currently, such a scenario is possible.
- Alice creates a new migration and commits after some joins.
- The migration ended unsuccessfully after 4 days.
- Then users can call
leave()orwithdrawContribution()to withdraw their deposits but it wouldn’t work properly because we should recalculate eth/fractional amounts with returned amounts after unsuccessful migration.
Tools Used
Solidity Visual Developer of VSCode
Recommended Mitigation Steps
We should add some restrictions to join() and leave() functions so that users can call these functions for 7 days before the migration is committed.
We should add these conditions to join() and leave().
require(!migrationInfo[_vault][_proposalId].isCommited, "committed already");
require(block.timestamp <= proposal.startTime + PROPOSAL_PERIOD, "proposal over");
Ferret-san (Fractional) confirmed
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 Fractional v2 contest. Code4rena made it public on 27 September 2022. Found in the 2022-07-fractional audit contest (finding M-08).
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.