Skip to content
Access control Audit finding Intermediate

Owner can lock tokens in MasterChef

The owner of MasterChef can remove a depositor from the whitelist, which prevents that depositor from withdrawing their staked tokens and rewards. An attacker with owner privileges could lock users' funds and cause a portion of Concur tokens to remain undistributed.

Czar102 Follow

Originally disclosed on Code4rena

Submitted by Czar102, also found by csanuragjain and Jujic

MasterChef.sol#L82-L84

Owner can remove a depositor. Since only depositors can deposit and withdraw, the owner may add a contract to the whitelist, let users deposit in the contract and remove the depositor from the whitelist. Depositor’s reward cannot be withdrawn then. And takes a share of Concur tokens that will not be distributed.

Recommended Mitigation Steps

Remove onlyDepositor modifier from the withdraw function.

leekt (Concur) disputed

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

The finding is valid in that the sponsor / owner can remove all depositors.

I believe having an immutable depositor that can’t be changed would give stronger security guarantees.

While the finding is valid, because it is contingent on a malicious owner, I believe Medium Severity to be more appropriate.


The original report as published on Code4rena, by Czar102. 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 is restricted by an onlyDepositor modifier, so removing a depositor from the whitelist also blocks withdrawal of already-deposited funds.

Impact

A malicious owner could lock depositors' funds and leave a share of Concur tokens undistributed, though this requires the owner to act maliciously.

What the attacker needed

Owner is malicious or compromised; users have deposited tokens

How it was found

  1. The owner adds a contract to the whitelist.
  2. Users deposit tokens into the contract.
  3. The owner removes the depositor from the whitelist.
  4. The depositor can no longer withdraw their 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.

In this smart contract, only addresses on a whitelist (called depositors) are allowed to put tokens in and take them out. The owner controls the whitelist, so the owner can remove an address after people have deposited, and then those people cannot withdraw their tokens. This means the owner has the power to lock other people's money.

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 Czar102

View all

12 more disclosed reports, best first.

More from Concur 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.