Skip to content
Access control Audit finding Intermediate

Owner of FraxlendPair can set arbitrary time lock contract address to circumvent time lock

The owner of a Fraxlend pair can change the time lock contract address to any arbitrary address, bypassing the enforced delay on protocol fee changes. This allows the owner to adjust fees without the intended time lock, potentially surprising users.

berndartmueller Follow

Originally disclosed on Code4rena

Submitted by berndartmueller

The ownership of a deployed Fraxlend pair is transferred to COMPTROLLER_ADDRESS on deployment via FraxlendPairDeployer_deploySecond. This very owner is able to change the currently used time lock contract address with the FraxlendPair.setTimeLock function. A time lock is enforced on the FraxlendPair.changeFee function whenever the protocol fee is adjusted.

However, as the Fraxlend pair owner is able to change the time lock contract address to any other arbitrary (contract) address, it is possible to circumvent this timelock without users knowing. By using a custom smart contract without an enforced time lock, the protocol fee can be changed at any time without a proper time lock.

Proof of Concept

FraxlendPair.sol#L206

/// @notice The ```setTimeLock``` function sets the TIME_LOCK address
/// @param _newAddress the new time lock address
function setTimeLock(address _newAddress) external onlyOwner {
    emit SetTimeLock(TIME_LOCK_ADDRESS, _newAddress);
    TIME_LOCK_ADDRESS = _newAddress;
}

Recommended Mitigation Steps

Currently, the owner COMPTROLLER_ADDRESS address is trustworthy, however, nothing prevents the above-described scenario. To protect users from sudden protocol fee changes, consider using a minimal time lock implementation directly implemented in the contract without trusting any external contract.

DrakeEvans (Frax) confirmed


The original report as published on Code4rena, by berndartmueller. 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 setTimeLock function allows the owner to set any address as the time lock, with no validation that the new address enforces a delay.

Impact

The owner could change protocol fees without the intended time lock, potentially surprising users who rely on the delay.

What the attacker needed

Owner privileges (COMPTROLLER_ADDRESS)

The fix

The time lock should be implemented directly in the contract rather than relying on an external, owner-settable address.

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 time lock is a delay that must pass before a sensitive change (like a fee) takes effect, giving users time to react. Here, the owner could swap out the time lock contract for one that doesn't actually delay anything, so they could change fees instantly. This means users might not get the warning period they expect.

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 berndartmueller

View all

97 more disclosed reports, best first.

More from Frax Ether Liquid Staking 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.