
Cloud Vulnerability DB
A community-led vulnerabilities database
OpenZeppelin Contracts, a library for smart contract development, was found to contain a vulnerability (CVE-2023-34459) affecting versions 4.7.0 to 4.9.2. The vulnerability allows attackers to forge valid multiproofs for arbitrary sets of leaves in merkle trees when using specific verification functions. The issue was discovered and disclosed on June 16, 2023, and affects the library's merkle proof verification functionality (Vendor Advisory).
The vulnerability exists in the verifyMultiProof, verifyMultiProofCalldata, processMultiProof, and processMultiProofCalldata functions. The issue occurs when a merkle tree contains a node with value 0 at depth 1 (just under the root). This can happen inadvertently in balanced trees with 3 leaves or less if the leaves are not hashed, or deliberately if a malicious tree builder includes such a node. The vulnerability has been assigned a CVSS v3.1 base score of 5.9 (Medium) with vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N (NVD).
When exploited, the vulnerability allows attackers to forge valid multiproofs for arbitrary sets of leaves in affected merkle trees. This could potentially compromise the integrity of systems relying on these merkle proof verifications. However, contracts using single-leaf proving functions (verify, verifyCalldata, processProof, or processProofCalldata) or multiproofs with known trees that have hashed leaves are not affected (Vendor Advisory).
The vulnerability has been patched in version 4.9.2. For those unable to update immediately, several workarounds are available: 1) Hash the leaves when constructing merkle trees and avoid inserting empty nodes, 2) Use the @openzeppelin/merkle-tree package which is not affected by this issue, 3) Do not accept user-provided merkle roots without reconstructing at least the first level of the tree, and 4) Verify the merkle tree structure by reconstructing it from the leaves (Vendor Advisory, Release Notes).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."