CVE-2024-27094
OpenZeppelin Contracts base64 encoding may read from potentially dirty memory
Also known as GHSA-9vx6-7xxf-x967
Mitigation
- Upgrade @openzeppelin/contracts to one of 4.9.6, 5.0.2 (or later in the same release line).
- Upgrade @openzeppelin/contracts-upgradeable to one of 5.0.2, 4.9.6 (or later in the same release line).
Who should check
- Projects that depend on npm package @openzeppelin/contracts (>= 4.5.0, < 4.9.6)
- Projects that depend on npm package @openzeppelin/contracts-upgradeable (>= 5.0.0-rc.0, < 5.0.2)
- Anyone running openzeppelin-contracts >= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2
Vulnerability facts
- Affected
- @openzeppelin/contracts >= 4.5.0, < 4.9.6; @openzeppelin/contracts-upgradeable >= 5.0.0-rc.0, < 5.0.2
- Fixed in
- 4.9.6, 5.0.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 6.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: Low
- Availability impact: High
- EPSS
- 0.88% chance of exploitation in 30 days (percentile 57, 2026-11-26)
- CWE
- CWE-125
- Modified
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm @openzeppelin/contracts | >= 4.5.0, < 4.9.6 | 4.9.6, 5.0.2 | osv |
| npm @openzeppelin/contracts-upgradeable | >= 5.0.0-rc.0, < 5.0.2 | 5.0.2, 4.9.6 | osv |
| openzeppelin-contracts | >= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-27094. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-27094.md Affected: @openzeppelin/contracts >= 4.5.0, < 4.9.6; @openzeppelin/contracts-upgradeable >= 5.0.0-rc.0, < 5.0.2 Fixed in: 4.9.6, 5.0.2 Steps: 1. Search this machine and project for @openzeppelin/contracts (npm), @openzeppelin/contracts-upgradeable (npm), openzeppelin-contracts: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
- https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/2d081f24cac1a867f6f73d512f2022e1fa987854
- https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1
- https://github.com/OpenZeppelin/openzeppelin-contracts/commit/92224533b1263772b0774eec3134e132a3d7b2a6
- https://github.com/OpenZeppelin/openzeppelin-contracts/commit/a6286d0fded8771b3a645e5813e51993c490399c
FAQ
Is CVE-2024-27094 being exploited?
There is no confirmed exploitation: CVE-2024-27094 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.88% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-27094?
Medium: CVSS 6.5 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-27094?
@openzeppelin/contracts >= 4.5.0, < 4.9.6; @openzeppelin/contracts-upgradeable >= 5.0.0-rc.0, < 5.0.2.
Is there a fix for CVE-2024-27094?
Yes. Fixed in 4.9.6, 5.0.2. Upgrade @openzeppelin/contracts to one of 4.9.6, 5.0.2 (or later in the same release line). Upgrade @openzeppelin/contracts-upgradeable to one of 5.0.2, 4.9.6 (or later in the same release line).
How do I check if I'm affected by CVE-2024-27094?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.