Skip to content
Access control Audit finding Intermediate

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.

shw Follow

Originally disclosed on Code4rena

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

  1. 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 ProposalFactory and is ready to be proposed.
  2. Alice calls the lodgeProposal function of ProposalFactory to propose her proposal.
  3. An attacker Bob, who listens to the mempool, notices Alice’s transaction and front-runs it. He calls the parameterize function to change the parameters to undesirable ones.
  4. 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


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

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

  1. Alice deploys a proposal contract and sets the intended parameters.
  2. Alice calls lodgeProposal on ProposalFactory to propose her proposal.
  3. Bob notices Alice's transaction in the mempool and front-runs it.
  4. Bob calls parameterize to change the parameters to undesirable ones.
  5. 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.

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.

Broken access control

The lesson behind this report.

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.