Tolerance is not enforced during a flash governance decision
The governance tolerance check was applied after the function body ran, so during a flash governance decision the parameters were not restricted. An attacker could set a soul's fps to an extremely large value and then claim inflated Flan rewards.
Submitted by shw
Most of the functions with a governanceApproved modifier call flashGoverner.enforceTolerance to ensure the provided parameters are restricted to some range of their original values. However, in the governanceApproved modifier, flashGoverner.setEnforcement(true); is called after the function body is executed, and thus the changed values are not restricted during the function execution.
An attacker can exploit this bug to change some critical parameters to arbitrary values by flash governance decisions. The effect will last until the community executes another proposal to correct the values. In the meanwhile, the attacker may make use of the corrupted values to launch an attack.
Proof of Concept
- An attacker executes a flash governance decision, for example, the
adjustSoulfunction ofLimbo, and sets thefpsof a soul to an extremely large value. - During the flash governance decision, some of his assets, for example, EYE, are locked in the
FlashGovernanceArbitercontract. - He calls
claimRewardto get his rewards on the corresponding soul (assume that he has staked some number of the token before). Because of the manipulatedfps, he gets a large number of Flan tokens as the reward. - Surely, he will lose his EYE tokens because of the malicious flash governance decision. However, as long as the attacker gets large enough Flan tokens, he is incentivized to launch such an attack.
Referenced code: DAO/Governable.sol#L46-L57 Limbo.sol#L380-L381 Limbo.sol#L327-L329 Limbo.sol#L530 Limbo.sol#L628-L630
Recommended Mitigation Steps
Rewrite the _governanceApproved function and the governanceApproved modifier as follows:
function _governanceApproved(bool emergency) internal {
bool successfulProposal = LimboDAOLike(DAO).successfulProposal(msg.sender);
if (successfulProposal) {
flashGoverner.setEnforcement(false);
} else if (configured) {
flashGoverner.setEnforcement(true);
flashGoverner.assertGovernanceApproved(msg.sender, address(this), emergency);
}
}
modifier governanceApproved(bool emergency) {
_governanceApproved(emergency);
_;
}
gititGoro (Behodler) confirmed but disagreed with High severity and commented:
So this is a vulnerability for the very first execution of flashgovernance decision on a contract, after which it’s safe. This is the type of thing that won’t be acted upon because it will have gone away by the time the public interacts with Limbo. However, it is technically true so I’m confirming the issue.
Jack the Pug (judge) decreased severity to Medium and commented:
Valid finding, but the conditions are quite strict, downgraded to
Med.
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
The enforcement flag was set after the function body executed, so the tolerance check did not apply during the call.
Impact
An attacker could inflate reward payouts and leave corrupted parameters in place until another proposal corrected them; the project confirmed this only affects the first flash governance execution on a contract, and the judge downgraded it to Medium because the conditions are strict.
What the attacker needed
First flash governance execution on a contract; attacker has staked tokens on the soul; attacker locks assets in FlashGovernanceArbiter
The fix
The enforcement flag should be set before the function body runs, so the tolerance check applies during the call.
How it was found
- The attacker starts a flash governance decision and calls adjustSoul on Limbo to set a soul's fps to an extremely large value.
- During that decision, some of the attacker's assets, such as EYE, are locked in the FlashGovernanceArbiter contract.
- The attacker calls claimReward on the soul, having staked some tokens beforehand.
- Because of the manipulated fps, the attacker receives a large number of Flan tokens as reward.
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 flash governance decision is a temporary approval that lets someone change settings for a single transaction. The code was meant to limit how far those settings could move, but the limit was switched on only after the change had already happened. So an attacker could push a reward rate very high, collect extra reward tokens, and accept losing the deposit they had locked.
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.