DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Invalid

Merkle Root Issue in `L2ContractMigrationFacet`

Summary

The L2ContractMigrationFacet contract facilitates the migration of assets owned by contracts from Layer 1 (L1) to Layer 2 (L2) using a merkle root for verification. This report identifies a critical issue with the hardcoded merkle root (MERKLE_ROOT) used for verification in the redeemDepositsAndInternalBalances function.

Vulnerability Details

The primary issue is the hardcoded nature of MERKLE_ROOT in the contract:

bytes32 private constant MERKLE_ROOT = 0xa84dc86252c556839dff46b290f0c401088a65584aa38a163b6b3f7dd7a5b0e8;

Using a hardcoded merkle root limits flexibility and adaptability. It assumes a fixed state of the merkle tree and does not accommodate updates or changes to the underlying data structure (e.g., deposits, internal balances) without deploying a new contract.

Impact

If the merkle root (MERKLE_ROOT) is compromised or incorrect, it can lead to unauthorized deposits being redeemed on L2, potentially resulting in financial losses. Hardcoding the merkle root limits the contract's ability to scale or evolve with changes in deposit structures or business requirements.

Tools Used

Manual Review

Recommendations

Implement a mechanism to dynamically generate or update the merkle root based on current deposit and internal balance data. This can be achieved by computing the merkle root on-chain based on stored data or using an off-chain oracle for periodic updates.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Gas

Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.