CVE-2024-27094
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.
Severity
MEDIUM
CVSS v3
6.5
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H · source cna
Exploit chance (EPSS)
0.763%
chance of exploitation in the next 30 days
higher than 56% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
None public
Exploit references (NVD and CNA): 0
Metasploit modules: 0
Nuclei templates: 0
Weakness
- CWE-125: Out-of-bounds Read
CISA SSVC decision points
| Exploitation | none |
|---|---|
| Automatable | no |
| Technical impact | partial |
| Scored | 2024-08-02 |
Timeline
- 2024-02-29Published by the CNA18:18 UTC
- 2024-02-29GitHub advisory published (GHSA-9vx6-7xxf-x967)same day
- 2024-08-02CISA SSVC decision recorded155 days after publication
Exploit and advisory records
GitHub advisory GHSA-9vx6-7xxf-x967, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| npm @openzeppelin/contracts | from 4.5.0 before 4.9.6 | 4.9.6 |
| npm @openzeppelin/contracts | from 5.0.0-rc.0 before 5.0.2 | 5.0.2 |
| npm @openzeppelin/contracts-upgradeable | from 4.5.0 before 4.9.6 | 4.9.6 |
| npm @openzeppelin/contracts-upgradeable | from 5.0.0-rc.0 before 5.0.2 | 5.0.2 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| openzeppelin contracts | from 4.5.0 before 4.9.6fixed in 4.9.6from 5.0.0 before 5.0.2fixed in 5.0.2 | 4.9.65.0.2 |
| openzeppelin contracts_upgradeable | from 5.0.0 before 5.0.2fixed in 5.0.2from 4.5.0 through 4.9.6no fix listed | 5.0.2not listed |
References
- 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
- https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-9vx6-7xxf-x967
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2024-27094'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2024-27094'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2024-27094'curl 'https://api.contrastcyber.com/cve_products/CVE-2024-27094'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).