Lack of access control in the parameterize function of proposal contracts
Proposal contracts allow anyone to call the parameterize function to change proposal parameters because it is only protected by the notCurrent modifier. An attacker can front-run a proposal transaction, alter the parameters to undesirable ones, causing the community to reject the proposal and the proposer to lose their deposit.
Submitted by shw, also found by hyh and jayjonah8
Most of the proposal contracts have a parameterize function for setting the proposal parameters, and these functions are protected only by the notCurrent modifier. When the proposal is proposed through a lodgeProposal transaction, an attacker can front-run it, modify the proposal parameters, and let the community vote it down. As a result, the person proposing loses his fate deposit.
Proof of Concept
- A benign user Alice wants to make a proposal, so she deploys one of the proposal contracts and sets the intended parameters. Her proposal is approved by the
ProposalFactoryand is ready to be proposed. - Alice calls the
lodgeProposalfunction ofProposalFactoryto propose her proposal. - An attacker Bob, who listens to the mempool, notices Alice’s transaction and front-runs it. He calls the
parameterizefunction to change the parameters to undesirable ones. - Alice’s proposal becomes the current proposal. However, the community rejects the proposal because of the changed parameters, causing Alice to lose her deposit.
Referenced code: DAO/Proposals/BurnFlashStakeDeposit.sol#L25-L37 DAO/Proposals/SetAssetApprovalProposal.sol#L21-L24 DAO/Proposals/ToggleWhitelistProposalProposal.sol#L22-L28 DAO/Proposals/UpdateMultipleSoulConfigProposal.sol#L40-L61 DAO/Proposals/WithdrawERC20Proposal.sol#L26-L32 DAO/ProposalFactory.sol#L74-L78
Recommended Mitigation Steps
Only allow the creator of the proposal to modify the parameters.
gititGoro (Behodler) acknowledged
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 parameterize function lacks access control, allowing any caller to modify proposal parameters before the proposal becomes current.
Impact
An attacker can cause a legitimate proposal to be rejected, resulting in the proposer losing their deposit.
What the attacker needed
Attacker can monitor the mempool; attacker can front-run transactions
The fix
Only allow the creator of the proposal to modify the parameters.
How it was found
- Alice deploys a proposal contract and sets the intended parameters.
- Alice calls lodgeProposal on ProposalFactory to propose her proposal.
- Bob notices Alice's transaction in the mempool and front-runs it.
- Bob calls parameterize to change the parameters to undesirable ones.
- The community rejects the proposal due to the changed parameters, and Alice loses her deposit.
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 proposal contract lets someone suggest a change to a system. The function that sets the proposal's details can be called by anyone, not just the person who created the proposal. An attacker can watch for a new proposal and quickly change its details before it is finalised, making voters reject it and costing the honest proposer their deposit.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.