Skip to content
Access control Audit finding Intermediate

DEPLOYER can drain DAOVault funds + manipulate proposal results

The DAOVault contract lacks a purgeDeployer function and allows the DEPLOYER role to call onlyDAO functions, so the deployer can deposit LP on behalf of any account and then withdraw the entire balance, draining vault funds and manipulating proposal voting weight.

hickuphh3 Follow

Originally disclosed on Code4rena

Submitted by hickuphh3

2 conditions enable the DEPLOYER to drain the funds in the DAOVault.

  • DAOVault is missing purgeDeployer() function
  • onlyDAO() is callable by both the DAO and the DEPLOYER

The DEPLOYER can, at any time, call depositLP() to increase the LP funds of any account, then call withdraw() to withdraw the entire balance.

The only good use case for the DEPLOYER here is to help perform emergency withdrawals for users. However, this could use a separate modifier, like onlyDeployer().

  1. DEPLOYER calls depositLP() with any arbitrary amount (maybe DAOVault’s pool LP balance - Alice’s deposited LP balance) for Alice and pool to increase their weight and balance.
  2. At this point, Alice may vote for a proposal to swing it in her favour, or remove it otherwise (to implicitly vote against it)
  3. DEPLOYER calls withdraw() for the Alice, which removes 100% of her balance (and therefore, the entire DAOVault’s pool balance)
  4. Create a separate role and modifier for the DEPLOYER, so that he is only able to call withdraw() but not depositLP()
  5. Include the missing purgeDeployer() function.

verifyfirst (Spartan) acknowledged:

We are already aware of the privilege level the deployer holds with returning user funds to user’s wallet. We disagree with the severity of this issue - however, agree it can be used to manipulate user’s weight from a proposal. We will include the purge deployer into the vault to resolve this issue.

ghoul-sol (judge) commented:

Privileged deployer is common in early stage protocols but because of lack of purgeDeployer function, I’ll keep this medium risk.

The original report as published on Code4rena, by hickuphh3. 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 access control modifier onlyDAO() was applied to both depositLP() and withdraw(), and no function existed to remove the deployer's privileges after deployment.

Impact

The deployer could drain all funds held in the DAOVault and manipulate proposal outcomes by altering voting weight; the project acknowledged the issue and planned to add a purge deployer function.

What the attacker needed

DEPLOYER role privileges; DAOVault holds LP funds

The fix

A separate role and modifier should be created so the DEPLOYER can only call withdraw() and not depositLP(), and the missing purgeDeployer() function should be added.

How it was found

  1. The DEPLOYER calls depositLP() with an arbitrary amount for Alice and the pool, increasing their weight and balance.
  2. Alice may then vote on a proposal to swing it in her favour or remove it to implicitly vote against it.
  3. The DEPLOYER calls withdraw() for Alice, removing 100% of her balance and the entire DAOVault pool balance.

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 smart contract has special roles, and one role called DEPLOYER was meant to help users get their funds back in an emergency. But the same role could also add fake deposits to any user's account and then withdraw everything, taking all the money in the vault and changing how votes are counted.

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 hickuphh3

View all

43 more disclosed reports, best first.

More from Spartan Protocol 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.