# CVE-2024-27094: OpenZeppelin Contracts base64 encoding may read from potentially dirty memory

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.76%, higher than 56% of CVEs (2026-12-01)
- Published: 2024-02-29T18:18:24.721Z
- Modified: 2026-06-17T07:19:09.020Z
- Also known as: GHSA-9vx6-7xxf-x967
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- OpenZeppelin openzeppelin-contracts: >= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2
- @openzeppelin/contracts (npm): from 4.5.0 before 4.9.6; from 5.0.0-rc.0 before 5.0.2
- @openzeppelin/contracts-upgradeable (npm): from 5.0.0-rc.0 before 5.0.2; from 4.5.0 before 4.9.6
- openzeppelin contracts: from 4.5.0 before 4.9.6; from 5.0.0 before 5.0.2
- openzeppelin contracts_upgradeable: from 4.5.0 up to 4.9.6; from 5.0.0 before 5.0.2

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H`
- NVD: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H`

## References

- <https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-9vx6-7xxf-x967> (vendor-advisory, web)
- <https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/2d081f24cac1a867f6f73d512f2022e1fa987854> (patch, web)
- <https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1> (patch, web)
- <https://github.com/OpenZeppelin/openzeppelin-contracts/commit/92224533b1263772b0774eec3134e132a3d7b2a6> (patch, web)
- <https://github.com/OpenZeppelin/openzeppelin-contracts/commit/a6286d0fded8771b3a645e5813e51993c490399c> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-27094> (advisory)
- <https://github.com/OpenZeppelin/openzeppelin-contracts> (package)

## Sources

- CVE List: [CVE-2024-27094](https://www.cve.org/CVERecord?id=CVE-2024-27094), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-9vx6-7xxf-x967](https://github.com/advisories/GHSA-9vx6-7xxf-x967), CC-BY-4.0, modified 2025-12-05
- NVD: [CVE-2024-27094](https://nvd.nist.gov/vuln/detail/CVE-2024-27094), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-27094 · Whole record: https://cve.day/CVE-2024-27094.json · Rebuilt by cve.day 2026-11-25T22:58:37.788Z
