openzeppelin-contracts: Out-of-bounds Read
CVE-2024-27094 is a high-severity out-of-bounds read vulnerability in openzeppelin-contracts from OpenZeppelin, with a CVSS 3.1 base score of 7.4 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected openzeppelin-contracts versions: >= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.76% chance of exploitation within 30 days, higher than 56% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Contracts to 4.9.6 or 5.0.2, whichever matches your release line, or a later version.
- Update Contracts Upgradeable to 5.0.2 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| OpenZeppelin | openzeppelin-contracts | >= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2 | Not stated |
| Openzeppelin | Contracts | 4.5.0 up to, but not including, 4.9.6; 5.0.0 up to, but not including, 5.0.2 | 4.9.6, 5.0.2 |
| Openzeppelin | Contracts Upgradeable | 4.5.0 through 4.9.6; 5.0.0 up to, but not including, 5.0.2 | 5.0.2 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- HighSuccess depends on conditions outside the attacker's control.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 6.5 | Medium | CNA (github.com) |
| CVSS 3.1 | 7.4 | High | NVD |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
How developers prevent this class of flaw
- Use a language that provides appropriate memory abstractions.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/2d081f24cac1a867f6f73d512f2022e1fa987854
- github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1
- github.com/OpenZeppelin/openzeppelin-contracts/commit/92224533b1263772b0774eec3134e132a3d7b2a6
- github.com/OpenZeppelin/openzeppelin-contracts/commit/a6286d0fded8771b3a645e5813e51993c490399c
Other vulnerabilities in openzeppelin-contracts
- 7.5 High severity
- 8.8 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Recent Out-of-bounds Read vulnerabilities
- 8.4 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 8.4 High severity
- 7.5 High severity
Spotted an error? Tell us.