Logic error in burnFlashGovernanceAsset can cause locked assets to be stolen
A logic error in the burnFlashGovernanceAsset function resets a user's pendingFlashDecision to default, allowing that user to withdraw another user's locked assets. An attacker can thus steal assets locked in future flash governance decisions.
Submitted by shw
A logic error in the burnFlashGovernanceAsset function that resets a user’s pendingFlashDecision allows that user to steal other user’s assets locked in future flash governance decisions. As a result, attackers can get their funds back even if they execute a malicious flash decision and the community burns their assets.
Proof of Concept
- An attacker Alice executes a malicious flash governance decision, and her assets are locked in the
FlashGovernanceArbitercontract. - The community disagrees with Alice’s flash governance decision and calls
burnFlashGovernanceAssetto burn her locked assets. However, theburnFlashGovernanceAssetfunction resets Alice’spendingFlashDecisionto the default config (see line 134). - A benign user, Bob executes another flash governance decision, and his assets are locked in the contract.
- Now, Alice calls
withdrawGovernanceAssetto withdraw Bob’s locked asset, effectively the same as stealing Bob’s assets. Since Alice’spendingFlashDecisionis reset to the default, theunlockTime < block.timestampcondition is fulfilled, and the withdrawal succeeds.
Referenced code: DAO/FlashGovernanceArbiter.sol#L134 DAO/FlashGovernanceArbiter.sol#L146
Recommended Mitigation Steps
Change line 134 to delete pendingFlashDecision[targetContract][user] instead of setting the pendingFlashDecision to the default.
gititGoro (Behodler) confirmed
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 burnFlashGovernanceAsset function sets the user's pendingFlashDecision to a default configuration instead of deleting it, which incorrectly satisfies the unlock condition for withdrawal.
Impact
An attacker could steal other users' assets locked in future flash governance decisions, and also recover their own assets after being burned.
What the attacker needed
Attacker has locked assets in a flash governance decision; community burns attacker's assets; another user locks assets in a flash governance decision
The fix
The fix is to change line 134 to delete the pendingFlashDecision mapping entry instead of setting it to the default.
How it was found
- An attacker executes a malicious flash governance decision, and her assets are locked in the FlashGovernanceArbiter contract.
- The community calls burnFlashGovernanceAsset to burn her locked assets, which resets her pendingFlashDecision to the default config.
- A benign user executes another flash governance decision, and his assets are locked in the contract.
- The attacker calls withdrawGovernanceAsset to withdraw the benign user's locked asset, succeeding because the unlock condition is fulfilled.
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.
This is a smart contract bug where a function that is supposed to burn a user's locked assets accidentally resets their pending decision to a default state. That reset makes the contract think the user has no pending decision, so they can later withdraw assets that belong to someone else. In simple terms, a user can get their own assets back after being punished and also steal another user's locked assets.
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.