Skip to content
Access control Audit finding Intermediate

compromised owner can drain funds from VeTokenMinter.sol

The owner of VeTokenMinter.sol can withdraw the entire contract balance to any address without delay or limit. If the owner is compromised, an attacker could drain all funds.

SmartSek Follow

Originally disclosed on Code4rena

Submitted by SmartSek, also found by ch13fd357r0y3r

Compromised owner can withdraw() entire balance of VeTokenMinter.sol to any other account.

Proof of Concept

https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L77-L81

function withdraw(address _destination, uint256 _amount) external onlyOwner {
    veToken.safeTransfer(_destination, _amount);

    emit Withdraw(_destination, _amount);
}

The owner can choose any _destination and _amount to send funds to with no delay or limit. These funds could be used to call Booster.deposit() and then Booster.withdraw()(withdraw) the equivalent in lptoken.

Recommended Mitigation Steps

Consider implementing a timelock on VeTokenMinter.withdraw() and changing the destination to an address that owner has no control over.

Example of similar issues illustrating the severity of the finding can be found here (H-09).

solvetony (veToken Finance) acknowledged and commented:

Requires compromised owner.

Alex the Entreprenerd (judge) decreased severity to Medium and commented:

Finding is valid, but contingent on a Malicious or Compromised Admin, Medium Severity is more appropriate.


The original report as published on Code4rena, by SmartSek. 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 withdraw function has no timelock or limit and allows the owner to send funds to any destination, so a compromised owner can drain the contract.

Impact

A compromised owner could drain the entire balance of VeTokenMinter.sol, which could then be used to withdraw equivalent LP tokens from the Booster contract.

What the attacker needed

Compromised owner account

The fix

The fix should add a timelock to withdraw and send funds only to an address the owner does not control.

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 an owner account that can call a withdraw function. That function lets the owner send all the contract's tokens to any address they choose. If someone steals the owner's key, they can take all the funds.

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 SmartSek

View all

2 more disclosed reports, best first.

More from veToken Finance 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.