← All posts
OWASPVulnerabilitiesUpgradeability

SC10: Proxy and Upgradeability Vulnerabilities in Smart Contracts

Security Wiz team3 min read

ShareTelegramX

Code on a blockchain normally can't be changed once it's live, which means a bug can't be fixed either. That's why many teams use an upgradeable proxy: the address users interact with stays the same while the logic behind it can be replaced. It solves one problem and creates another. SC10 on the OWASP Smart Contract Top 10 for 2026 covers how it goes wrong.

How a proxy works, briefly

Think of a shop counter with a back office. Users deal with the counter, which is the proxy. It keeps all the records. When a request comes in, the counter passes it to the back office, called the implementation contract, which holds the instructions for what to do. The back office does its work directly on the counter's records. To upgrade, you point the counter at a new back office.

That arrangement creates three things to get right: the implementation, the way the records are laid out, and who is allowed to upgrade.

What goes wrong

An implementation nobody set up. The implementation also exists as a contract in its own right. If its setup step, usually a function called initialize, was never run, anyone can run it and become its owner. Depending on the design, that can let them take over or destroy the logic the proxy depends on.

Setup that can be run again. A setup function that can run more than once lets an attacker reset who the owner is, or change key settings.

Records that don't line up. The proxy's records are like a filing cabinet, and each version of the logic expects to find each item in a particular drawer. If a new version reorders, removes, or inserts a drawer, it quietly reads and writes the wrong data. A balance can end up in the drawer where the owner's address used to be.

An unlocked upgrade function. If the function that swaps in new logic isn't restricted, anyone can replace your logic with their own. In one popular design, called UUPS, the upgrade function lives inside the logic itself, and forgetting to restrict it is a classic mistake.

A single powerful key. If one ordinary wallet can upgrade the contract, a stolen key lets the thief swap in logic that takes everything, with no warning to users.

A botched migration. Upgrades often run a one-time script to carry the records over to the new version. That script can contain errors, or may never have been tested against the real records.

The fixes

Lock the implementation so nobody can run its setup step directly:

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
    _disableInitializers();
}

Restrict who is allowed to approve an upgrade. Here, only the owner can:

function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}

And more broadly:

  • Use well-maintained, widely used code for the proxy and its setup logic, not something written from scratch.
  • Use upgrade-checking tools that compare how the records are laid out in the old and new versions, and stop you if they don't match.
  • Put the power to upgrade behind a multisig, a wallet that needs several people to approve each action, and a timelock, a built-in waiting period. Users can then see an upgrade coming and leave before it takes effect.
  • Ask whether the contract needs to be upgradeable at all. If it does, consider giving up the upgrade power for good once the code has matured.
  • Write down who holds each key and the exact steps of an upgrade.

How we test it

This is a category where reading the code isn't enough, because the risk lives in the system as it actually runs. On the Fork tier we test on a fork, a private copy of the live blockchain.

  • Launch on the fork exactly as your scripts do, then check who ends up as owner and administrator, and confirm the implementation's setup step has been run.
  • Try to run setup again, on the proxy and directly on the implementation.
  • Compare how the records are laid out from one version to the next, and test the upgrade on the fork against the real records.
  • Review who can upgrade: who holds that power, whether it's a multisig, whether there's a timelock, and how quickly a change could happen. This feeds the upgrades category of our grade.

Upgradeability trades certainty for flexibility. Users are trusting whoever holds the key as much as they trust the code. Request an audit to have the whole system, keys included, reviewed.

ShareTelegramX

Shipping something onchain?

Send us your repo and we’ll return a quote within 24 hours.

Request an Audit