OpenZeppelin Contracts base64 encoding may read from potentially dirty memory
openzeppelin-contracts
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @openzeppelin/contracts npm |
|
|
| @openzeppelin/contracts-upgradeable npm |
|
openzeppelin-contracts
| Product | Affected | Fixed in |
|---|---|---|
| @openzeppelin/contracts npm |
|
|
| @openzeppelin/contracts-upgradeable npm |
|
|
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.
From the CVE record · GitHub_M
OpenZeppelin Contracts’ Base64.encode may read beyond its input buffer when the input length is not a multiple of three. An attacker who can cause the function to encode such an input may trigger the read. Network or local access, authentication, and user-interaction requirements are not specified.
Check applications using npm @openzeppelin/contracts or @openzeppelin/contracts-upgradeable versions >=4.5.0 <4.9.6 or >=5.0.0-rc.0 <5.0.2.