CyberSecBulletin
CVE-2024-27094NVD status: Analyzed

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.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Contracts to 4.9.6 or 5.0.2, whichever matches your release line, or a later version.
  2. Update Contracts Upgradeable to 5.0.2 or a later version.
  3. Read the advisory on github.com for workarounds and exact fixed builds.
  4. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
OpenZeppelinopenzeppelin-contracts>= 4.5.0, < 4.9.6; >= 5.0.0-rc.0, < 5.0.2Not stated
OpenzeppelinContracts4.5.0 up to, but not including, 4.9.6; 5.0.0 up to, but not including, 5.0.24.9.6, 5.0.2
OpenzeppelinContracts Upgradeable4.5.0 through 4.9.6; 5.0.0 up to, but not including, 5.0.25.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 systemScoreSeverityScored by
CVSS 3.16.5MediumCNA (github.com)
CVSS 3.17.4HighNVD

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.

More Out-of-bounds Read vulnerabilities (CWE-125)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in openzeppelin-contracts

All openzeppelin-contracts vulnerabilities

Recent Out-of-bounds Read vulnerabilities

Spotted an error? Tell us.