Out-of-bounds Read Affecting @openzeppelin/contracts package, versions >=5.2.0 <5.4.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-OPENZEPPELINCONTRACTS-10773735
  • published18 Jul 2025
  • disclosed17 Jul 2025
  • creditUnknown

Introduced: 17 Jul 2025

NewCVE-2025-54070  (opens in a new tab)
CWE-125  (opens in a new tab)

How to fix?

Upgrade @openzeppelin/contracts to version 5.4.0 or higher.

Overview

@openzeppelin/contracts is a library for contract development.

Affected versions of this package are vulnerable to Out-of-bounds Read via the lastIndexOf function when the buffer is empty and the pos argument is not set to its maximum value. An attacker can cause the function to access memory outside the intended buffer, potentially resulting in unexpected behavior such as returning an invalid index or causing a revert, by supplying crafted arguments.

CVSS Base Scores

version 4.0
version 3.1