Skip to content

Upgrade Without Timelock or Governance

SAFE-0232 Upgradeability Checked automatically by the scanner
1

What goes wrong

The upgrade function is controlled by a single owner/EOA with no timelock. That key can swap in malicious implementation code instantly, draining all funds with zero warning to users.

2

The vulnerable pattern

proof of concept — how it is exploited
// owner upgradeTo(EvilImpl) where EvilImpl.withdrawAll() sends funds
// to the owner. No delay -> users cannot exit before the drain.
3

How to fix it

the pattern that is safe
// gate _authorizeUpgrade behind a timelock/multisig with a delay
function _authorizeUpgrade(address) internal override onlyRole(UPGRADER_ROLE) {}
// where UPGRADER_ROLE is held only by a timelock
Upgrades must pass through a timelock/governance delay.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0232 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs