title: OpenZeppelin Contracts base64 encoding may read from potentially dirty memory
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.
problem types: CWE-125: Out-of-bounds Read
affected:
{
vendor: OpenZeppelin
product: openzeppelin-contracts
versions:
version: >= 4.5.0, < 4.9.6, status: affected
version: >= 5.0.0-rc.0, < 5.0.2, status: affected
}
metrics:
cvssV3_1: [
attackComplexity: HIGH
attackVector: NETWORK
availabilityImpact: HIGH
baseScore: 6.5
baseSeverity: MEDIUM
confidentialityImpact: NONE
integrityImpact: LOW
privilegesRequired: NONE
scope: UNCHANGED
userInteraction: NONE
vectorString: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
version: 3.1
]