Migration’s leave function allows leaving a committed proposal
The leave function does not check whether a proposal has been committed, so a user can call it after a failed committed proposal and receive their original contribution instead of the adjusted amount from the buyout auction. This can cause a deficit and loss of assets for other users.
Submitted by kenzo
The leave function allows to leave a proposal even if the proposal has been committed and failed. This makes it a (probably unintended) duplicate functionality of withdrawContributions, which is the function that should be used to withdraw failed contributions.
Impact
User assets might be lost: When withdrawing assets from a failed migration, users should get back a different amount of assets, according to the buyout auction result. (I detailed this in another issue - “Migration::withdrawContribution falsely assumes that user should get exactly his original contribution back”). But when withdrawing assets from a proposal that has not been committed, users should get back their original amount of assets, as that has not changed. Therefore, if leave does not check if the proposal has been committed, users could call leave instead of withdrawContribution and get back a different amounts of assets than they deserve, on the expense of other users.
Proof of Concept
The leave function does not check anywhere whether proposal.isCommited == true.
Therefore, if a user calls it after a proposal has been committed and failed, it will continue to send him his original contribution back, instead of sending him the adjusted amount that has been returned from Buyout.
Recommended Mitigation Steps
Revert in leave if proposal.isCommited == true. You might be also able to merge the functionality of leave and withdrawContribution, but that depends on how you will implement the fix for withdrawContribution.
Ferret-san (Fractional) confirmed
HardlyDifficult (judge) commented:
Users can withdraw more than expected after a failed proposal, which leads to a deficit and loss of assets for others. Agree with High risk.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Users could withdraw more than expected after a failed proposal, causing a deficit and loss of assets for other users.
What the attacker needed
A committed and failed proposal; user has contributed to the proposal
The fix
The leave function should revert if the proposal is committed; the functionality might also be merged with withdrawContribution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In this system, users put in assets for a proposal. If the proposal fails after being committed, they are supposed to use a special function to get back an adjusted amount based on an auction. But another function lets them take back their original amount, which can be more than they should get, leaving less for others.
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.