OpenzeppelinApplication

CVE-2021-46320

HIGH · 7.5 CVSS v3.1 Published 2022-02-04
Fix available
A fix is available. Upgrade to after 4.4.0 or later.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
In OpenZeppelin <=v4.4.0, initializer functions that are invoked separate from contract creation (the most prominent example being minimal proxies) may be reentered if they make an untrusted non-view external call. Once an initializer has finished running it can never be re-executed. However, an exception put in place to support multiple inheritance made reentrancy possible, breaking the expectation that there is a single execution.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

In OpenZeppelin contracts v4.4.0 and earlier, initializer functions in minimal proxy patterns can be reentered due to an exception in the initialization guard designed to support multiple inheritance. This breaks the one-time execution guarantee of initializers, allowing an attacker to potentially re-enter and execute the initializer multiple times through an untrusted non-view external call.

MitigationUpgrade to OpenZeppelin v4.4.1 or later which patches the reentrancy guard in initializer functions. Review and potentially redeploy any proxy contracts using the affected library versions.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
OpenzeppelinApplication
Affected:>= 3.2.0, <= 4.4.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify OpenZeppelin version in your project
    Check your package.json, lock file (package-lock.json or yarn.lock), or smart contract import statements for the OpenZeppelin contracts version. Look for lines containing '@openzeppelin/contracts' and compare the version number to the affected range (>= 3.2.0, <= 4.4.0).
    Affected if The project uses OpenZeppelin contracts version 3.2.0 through 4.4.0 inclusive.
  2. Verify minimal proxy pattern usage
    Search your deployed proxy contracts for the minimal proxy bytecode pattern (EIP-1167), which typically contains '363d3d373d3d3d363d30545f73' at the beginning. Review contract deployment scripts that create proxy instances using OpenZeppelin's Clone, Clones, or minimal proxy utilities.
    Affected if Your project deploys or uses minimal proxy clones derived from OpenZeppelin contracts within the affected version range.
  3. Identify vulnerable initializer functions
    Examine your proxy implementation contracts that inherit from OpenZeppelin initializable functions. Check if any initializer functions make external calls to untrusted addresses or contain callback mechanisms that could be exploited during initialization. Review the function modifiers used on initializer functions.
    Affected if Your proxy contracts use OpenZeppelin initializers from versions 3.2.0-4.4.0 that perform external calls to user-controlled addresses during execution.
  4. Review initialization guard implementation
    Inspect the OpenZeppelin Initializable.sol contract in your project's node_modules (or the version you are using). Look for the initialization guard logic that supports multiple inheritance. Check whether the guard can be bypassed through reentrancy patterns during the initial first initialization call.
    Affected if The Initializable.sol implementation lacks proper reentrancy protection on the initialization guard, allowing multiple initializer executions.

Your environment is affected if you have deployed minimal proxy contracts using OpenZeppelin contracts versions 3.2.0 through 4.4.0 where initializers can be reentered to bypass the one-time execution guarantee.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 4.4.0
Interim mitigation

Upgrade to OpenZeppelin v4.4.1 or later which patches the reentrancy guard in initializer functions. Review and potentially redeploy any proxy contracts using the affected library versions.

Recommended fix High confidence

OpenZeppelin Contracts >=4.4.1

  1. 1. Identify all contracts in your project that use OpenZeppelin libraries within version range >=3.2.0 and <=4.4.0
  2. 2. Update your project's dependency management system (e.g., npm/package.json, hardhat.config.js, or truffle-config) to specify OpenZeppelin Contracts version 4.4.1 or later
  3. 3. Run dependency update command (e.g., npm update @openzeppelin/contracts or yarn upgrade @openzeppelin/contracts)
  4. 4. Recompile all contracts to ensure new library references are used
  5. 5. Retest all contract functionality, particularly initializer functions and any contracts using minimal proxy patterns (EIP-1167)
  6. 6. If using upgradeable proxy patterns, ensure proxy contracts are re-deployed with the new implementation
Caveat Minor: Version 4.4.1 includes security fixes that may affect contract behavior; review OpenZeppelin 4.4.1 release notes for any minor changes to initializer or inheritance behavior

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Openzeppelin Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA4.0 h
20.0 hours of engineering $3,560
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,696.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-46320 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-46320 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data