Skip to content
Business logic Audit finding Beginner

It is clearly stated that timelock is used, but this does not happen in the codes

The project's documentation claims a timelock is used for contract ownership management, but the function that sets the delay for renouncing ownership is never called, so no timelock is actually enforced. An attacker who gains owner privileges could renounce ownership immediately without the intended delay.

0xSmartContract Follow with carrotsmuggler

Originally disclosed on Code4rena

Submitted by 0xSmartContract, also found by carrotsmuggler

It is stated in the documents that “contract ownership management” is used with a timelock;

README.md:
  122: - Does it use a timelock function?: Yes but only for contract ownership management and not business critical functions.

However, the function _setupDelayForRenouncingOwnership where timelock is specified in the OwnableTwoSteps.sol contract where owner privileges are set is not used in the project, so a timelock cannot be mentioned.

 function _setupDelayForRenouncingOwnership(uint256 _delay) internal {
        delay = _delay;
    }

This is stated in the NatSpec comments but there is no definition as stated in the comments;

contracts/OwnableTwoSteps.sol:
  40:      *         Delay (for the timelock) must be set by the contract that inherits from this.

Recommended Mitigation Steps

contracts/OwnableTwoSteps.sol:

    // Delay for the timelock (in seconds)
    uint256 public delay;

  43       */
  44:     constructor(uint256 _delay) {
  45:         owner = msg.sender;
  +           delay = _delay;
  46:     }
  47:
  48      /**

0xhiroshi (LooksRare) confirmed


The original report as published on Code4rena, by 0xSmartContract. 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 constructor of the inheriting contract did not call the internal function that sets the timelock delay, leaving the delay at its default value.

Impact

The absence of a timelock means that an owner could renounce ownership immediately, potentially leaving the contract without an owner and causing operational disruption.

What the attacker needed

Owner privileges

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 timelock is a delay that must pass before a sensitive action (like giving up ownership of a contract) can take effect. The project said it had one, but the code that sets the delay was never used, so the delay was zero. This means someone with owner rights could renounce ownership instantly, which might leave the contract without an owner and disrupt its operation.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xSmartContract

View all

6 more disclosed reports, best first.

More from LooksRare Aggregator contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.