Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

CVE-2024-27094 is a medium-severity (CVSS 6.5) Out-of-bounds Read vulnerability in @openzeppelin/contracts. O3 Security confirms whether CVE-2024-27094 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

OpenZeppelin Contracts base64 encoding may read from potentially dirty memory

Also known asGHSA-9vx6-7xxf-x967
Published
Feb 29, 2024
Updated
Jul 16, 2026
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Jul 16, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Real-World Exposure

4 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.

@openzeppelin/contractsnpm
889Kdownloads / week
@openzeppelin/contracts-upgradeablenpm
222Kdownloads / week

Description

OpenZeppelin Contracts is a library for secure smart contract development. The Base64.encode function encodes a bytes input by iterating over it in chunks of 3 bytes. When this input is not a multiple of 3, the last iteration may read parts of the memory that are beyond the input buffer. The vulnerability is fixed in 5.0.2 and 4.9.6.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
📦npm@openzeppelin/contracts4.5.0&&< 4.9.64.9.6
📦npm@openzeppelin/contracts-upgradeable5.0.0-rc.0&&< 5.0.25.0.2
📦npm@openzeppelin/contracts5.0.0-rc.0&&< 5.0.25.0.2
📦npm@openzeppelin/contracts-upgradeable4.5.0&&< 4.9.64.9.6

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @openzeppelin/contracts. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update @openzeppelin/contracts to 4.9.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-27094 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether CVE-2024-27094 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to CVE-2024-27094. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

OpenZeppelin Contracts is a library for secure smart contract development. The `Base64.encode` function encodes a `bytes` input by iterating over it in chunks of 3 bytes. When this input is not a multiple of 3, the last iteration may read parts of the memory that are beyond the input buffer. The vulnerability is fixed in 5.0.2 and 4.9.6.
O3 Security · Impact-Aware SCA

Is CVE-2024-27094 in your dependencies?

O3 detects CVE-2024-27094 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

CVE-2024-27094: @openzeppelin/contracts… | O3 Security