Skip to content
Access control Audit finding Beginner

Overprivileged admin can grant unlimited WETH

The admin can call a function to grant an unlimited amount of reward tokens, such as WETH, to any address without any timelock or limit. If the admin key is compromised, an attacker could drain all reward tokens from the contract immediately.

hake Follow

Originally disclosed on Code4rena

Submitted by hake

https://github.com/Plex-Engineer/lending-market/blob/755424c1f9ab3f9f0408443e6606f94e4f08a990/contracts/Comptroller.sol#L1376

Admin can _grantComp() to any address using any amount and drain the contract.

Proof of Concept

If admin key gets compromised there is no timelock, no amount boundaries and no address limitations to prevent the assets to be drained immediately to the attacker’s address.

Recommended Mitigation Steps

There is a few suggestions that could help mitigate this issue: Implement timelock for _grantComp() Implement hard coded recipient so funds cannot be arbitrarily sent to any address. Implement a limit to the amount that can be granted.

Here is a reference to a past submission where this issue has been made by team Watchpug: https://github.com/code-423n4/2022-01-insure-findings/issues/271

nivasan1 (Canto) acknowledged and commented:

We acknowledge that this is an issue, however we feel that changing the core functionality of compound would be too costly.

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

The warden has shown how the Admin could sweep the reward token(in this case WETH) to any address, at any time, for an amount equal to all tokens available to the Comptroller.

Because this is contingent on admin privilege, I think Medium Severity to be more appropriate.


The original report as published on Code4rena, by hake. 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 admin function `_grantComp()` lacks any timelock, amount limit, or recipient restriction, giving the admin unchecked power to transfer all reward tokens.

What the attacker needed

Compromised admin key

The fix

The report recommends adding a timelock, hardcoding the recipient, and limiting the grant amount; the team acknowledged the issue but did not fix it because changing core functionality was deemed too costly.

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, a special user called the admin has a function that lets them send reward tokens to anyone. There are no rules like a waiting period or a maximum amount, so if someone steals the admin's key, they can take all the tokens at once.

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 hake

View all

5 more disclosed reports, best first.

More from Canto

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.