Failed proposal can be committed again
The commit function in the Migration contract can be called multiple times for the same proposal if the buyout fails within the 7-day migration period. Combined with a separate flaw where the contract does not account for the actual number of fractions returned from a failed buyout, an attacker can repeatedly commit and steal ETH from the migration contract.
Submitted by 0x52, also found by hansfriese
Failed proposal can be committed again and eth stolen from migration contract in combination with other vulnerabilities submitted.
Proof of Concept
Commit can be called as long as it has been less than 7 days from the start time. The buyout period is specified as 4 days in the buyout contract. This means that as long as proposal is committed within 3 days of starting, commit can be called again after a failed buyout (4 days) because the current time will still be less than 7 days from the start time.
This can be used in combination with a vulnerability I previously reported. The contract does not account for the actual number of fractions that it receives back from a failed buyout. If it sent 10 fractions and 3 eth to a buyout it may receive back 15 fractions and 2 eth due to trading against the buyout. Because commit can called again on the same proposal, the second time it will try to send the fraction balance of the contract, now 15, and the value of the eth in the proposal, 3 eth. This transaction will either revert due to not having enough eth or it will send 3 eth pulling from eth deposited to other migration proposals.
This could be exploited by creating a vault and immediately migrating it. Once the migration starts the user could sell fractions to themselves and get eth, making sure to keep the number of fractions under 51%, to prevent a successful buyout. After the buyout fails they can then call the commit function again and more eth will be sent. They can then sell fractions to themselves netting more eth than they initially supplied. This could be done repeatedly until all eth has been stolen from the migration contract.
Recommended Mitigation Steps
Change the length of either the migration period or the buyout period to match so that a proposal can’t be replayed.
stevennevins (Fractional) confirmed
HardlyDifficult (judge) commented:
Committing a failed proposal multiple times can steal funds from the migration contract. Agree this is High risk.
Making this submission the primary for talking through the potential vulnerability here.
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
Root cause
Likely the migration period (7 days) is longer than the buyout period (4 days), allowing a failed proposal to be committed again before the migration period ends, and the contract does not track the actual number of fractions returned from a failed buyout.
Impact
An attacker could steal ETH from the migration contract, potentially draining all funds.
What the attacker needed
Ability to create a vault and migrate; Ability to trade fractions
The fix
Change the length of either the migration period or the buyout period so that a proposal cannot be replayed.
How it was found
- Create a vault and immediately migrate it.
- Sell fractions to yourself to get ETH, keeping the number of fractions under 51% to prevent a successful buyout.
- After the buyout fails, call the commit function again to send more ETH.
- Sell fractions to yourself again to net more ETH than initially supplied.
- Repeat until all ETH is stolen from the migration contract.
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.
A smart contract allowed the same proposal to be committed more than once if the first attempt failed. By exploiting another bug that miscalculates token balances, an attacker could repeatedly trigger commits and drain funds from the contract.
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.