Skip to content
Access control Audit finding Beginner

Missing event & timelock for critical onlyAdmin functions

Critical admin functions in the VaultTracker contract can change key parameters without emitting events or using timelocks. This means users and other privileged roles cannot detect upcoming changes or react in time, potentially leading to unexpected financial or trust impacts.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev, also found by defsec.

Impact

onlyAdmin functions that change critical contract parameters/addresses/state should emit events and consider adding timelocks so that users and other privileged roles can detect upcoming changes (by offchain monitoring of events) and have the time to react to them.

Privileged functions in all contracts, for e.g. VaultTracker onlyAdmin, have direct financial or trust impact on users who should be given an opportunity to react to them by exiting/engaging without being surprised when changes initiated by such functions are made effective opaquely (without events) and/or immediately (without timelocks).

See similar Medium-severity finding in ConsenSys’s Audit of 1inch Liquidity Protocol (https://consensys.net/diligence/audits/2020/12/1inch-liquidity-protocol/#unpredictable-behavior-for-users-due-to-admin-front-running-or-general-bad-timing)

Proof of Concept

and others

Tools Used

Manual Analysis

Recommended Mitigation Steps

Add events to all possible flows (some flows emit events in callers) and consider adding timelocks to such onlyAdmin functions.

0xean (judge) commented:

removing duplicate mark since the (valid) suggestion to emit events on the changes made by admin calls

The original report as published on Code4rena, by 0xRajeev. 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 admin functions lack event emission and timelock mechanisms, making changes opaque and immediate.

Impact

Users and privileged roles cannot detect or react to critical parameter changes, which could lead to financial loss or loss of trust.

What the attacker needed

Admin privileges

The fix

Add events to all admin functions that change critical parameters and consider adding timelocks to such functions.

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 smart contracts, some functions can only be called by an administrator. If these functions change important settings without announcing it (by emitting an event) or without a delay (a timelock), users might not know until it's too late. This lack of transparency can be risky because users can't react to changes that affect their funds or trust.

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 0xRajeev

View all

61 more disclosed reports, best first.

More from Swivel v3 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.