Skip to content
Business logic Audit finding Intermediate

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.

shw Follow

Originally disclosed on Code4rena

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

  1. An attacker Alice executes a malicious flash governance decision, and her assets are locked in the FlashGovernanceArbiter contract.
  2. The community disagrees with Alice’s flash governance decision and calls burnFlashGovernanceAsset to burn her locked assets. However, the burnFlashGovernanceAsset function resets Alice’s pendingFlashDecision to the default config (see line 134).
  3. A benign user, Bob executes another flash governance decision, and his assets are locked in the contract.
  4. Now, Alice calls withdrawGovernanceAsset to withdraw Bob’s locked asset, effectively the same as stealing Bob’s assets. Since Alice’s pendingFlashDecision is reset to the default, the unlockTime < block.timestamp condition 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


The original report as published on Code4rena, by shw. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

  1. An attacker executes a malicious flash governance decision, and her assets are locked in the FlashGovernanceArbiter contract.
  2. The community calls burnFlashGovernanceAsset to burn her locked assets, which resets her pendingFlashDecision to the default config.
  3. A benign user executes another flash governance decision, and his assets are locked in the contract.
  4. 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.

More by shw

View all

22 more disclosed reports, best first.

More from Behodler contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.