Logic error in burnFlashGovernanceAsset
can cause locked assets to be stolen
#305
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
shw
Vulnerability details
Impact
A logic error in the
burnFlashGovernanceAsset
function that resets a user'spendingFlashDecision
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
FlashGovernanceArbiter
contract.burnFlashGovernanceAsset
to burn her locked assets. However, theburnFlashGovernanceAsset
function resets Alice'spendingFlashDecision
to the default config (see line 134).withdrawGovernanceAsset
to withdraw Bob's locked asset, effectively the same as stealing Bob's assets. Since Alice'spendingFlashDecision
is reset to the default, theunlockTime < 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 thependingFlashDecision
to the default.The text was updated successfully, but these errors were encountered: