CVE-2024-27094: OpenZeppelin Contracts base64 encoding may read from potentially dirty memory
Affects @openzeppelin/contractsSource GCVE Database
Not known to be exploited · CVSS 6.5 Medium : upgrade to 4.9.6 when convenient.
Data as of 25 Nov 2026, 03:43 UTC
- Patch
- Available – fixed in 4.9.6, 5.0.2
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:HExploitation evidence
Disclosed: evidence found.
CVE published 29 Feb 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 24 Nov 2026.
What to do
Upgrade @openzeppelin/contracts and @openzeppelin/contracts-upgradeable to 4.9.6; @openzeppelin/contracts-upgradeable and @openzeppelin/contracts to 5.0.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npm@openzeppelin/contracts | Affected
| Fixed in
|
| npm@openzeppelin/contracts-upgradeable | Affected
| Fixed in
|
| npm@openzeppelin/contracts | Affected
| Fixed in
|
| npm@openzeppelin/contracts-upgradeable | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade to OpenZeppelin Contracts version 4.9.6 or later, or 5.0.2 or later, where this issue is fixed. Applying these official patches fully mitigates the vulnerability. No other specific mitigations are indicated by the vendor advisory.
Description
The OpenZeppelin Contracts library's Base64 encoding function may read memory beyond the intended input buffer when the input length is not a multiple of three. This can cause up to 4 bits of potentially uninitialized or 'dirty' memory to be included in the encoded output, leading to output corruption. The issue affects versions 4.5.0 up to but not including 4.9.6, and 5.0.0-rc.0 up to but not including 5.0.2. Fixed versions 4.9.6 and 5.0.2 address this problem.
References
- github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-9vx6-7xxf-x967 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2024-27094 (opens in a new tab)
- github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/2d081f24cac1a867f6f73d512f2022e1fa987854 (opens in a new tab)
- github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1 (opens in a new tab)
- github.com/OpenZeppelin/openzeppelin-contracts/commit/92224533b1263772b0774eec3134e132a3d7b2a6 (opens in a new tab)
- github.com/OpenZeppelin/openzeppelin-contracts/commit/a6286d0fded8771b3a645e5813e51993c490399c (opens in a new tab)
- github.com/OpenZeppelin/openzeppelin-contracts (opens in a new tab)