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.
Submitted by Czar102, also found by csanuragjain and Jujic
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.
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.
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
- The owner adds a contract to the whitelist.
- Users deposit tokens into the contract.
- The owner removes the depositor from the whitelist.
- 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.