Skip to content
Access control Audit finding Intermediate

Timelock should handle queuing transactions and

The report notes that the timelock contract does not restrict which functions can be queued, so a compromised multisig could queue transactions other than upgrades, such as proxy ownership changes. It also notes that implementation contracts are left uninitialised, which could become dangerous if a future implementation uses delegatecall.

conqueror Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

26501 - [SC - Insight] Timelock should handle queuing transactions and...

Submitted on Dec 4th 2023 at 04:58:15 UTC by @conqueror for Boost | DeGate

Report ID: #26501

Report type: Smart Contract

Report severity: Insight

Target: https://etherscan.io/address/0xf2991507952d9594e71a44a54fb19f3109d213a5#code

Impacts:

  • Timelock should handle queuing deploys and initializing implementation contracts

Description

Bug Description

Even if an unauthorized party was able to gain access to the Multisig, they should not be able to queue up transactions besides upgrade transactions (for example, ones changing the proxy ownership).

Furthermore, your implementation contracts are currently uninitialized. While this is not a concern at the moment, if you ever upgrade to an implementation contract that uses delegatecall in any way, this could become a big problem.

The timelock contract therefore should be in charge of:

  1. Queueing up implementation contract deploys (you can set delay to 0 here), and calling initialize on the implementation contract
  2. Only allow upgrade to be called on the proxy contracts, and not other functions. Do this by checking the signature.

Impact

Mitigate damage if multisig is ever compromised and initialize implementations. Not initializing implementations can be extremely bad in the future if you ever upgrade them to use delegatecall

Risk Breakdown

Difficulty to Exploit: Easy Weakness: Low CVSS2 Score: L

Recommendation

Refactor the timelock contract a bit, as described above

References

The original report as published on Immunefi, by conqueror. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 timelock does not check the function signature of queued calls, and implementation contracts are deployed without calling initialize.

Impact

If the multisig were compromised, the attacker could queue transactions beyond upgrades, and uninitialised implementations could become a serious problem if later upgraded to use delegatecall.

What the attacker needed

Compromise of the multisig; future upgrade using delegatecall

The fix

The timelock should be refactored to queue implementation deploys and call initialize, and to allow only upgrade calls on proxies by checking the signature.

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 contract that delays actions so people can review them before they happen. Here the timelock lets any kind of action be queued, not just upgrades, so if the multisig (a wallet needing several signatures) were ever compromised, the attacker could queue harmful changes. Separately, the implementation contracts were never set up with an initial state, which is harmless now but risky if a future version relies on delegatecall (running another contract's code in its own storage).

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 from DeGate

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.