DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: high
Valid

`L2ContractMigrationFacet` overwrites user's deposit, instead of increasing it

Summary

L2ContractMigrationFacet overwrites user's deposit, instead of increasing it

Vulnerability Details

Currently, when migrating the deposits, if the receiver address has a deposit with the same depositId, both amount and bdv will be overwritten instead of increased.

// add deposit to account.
s.accts[account].deposits[depositId].amount = depositData.amounts[i];
s.accts[account].deposits[depositId].bdv = depositData.bdvs[i];

As the owner can choose any receiver they wish, this can even be weaponized to target users with big deposits and overwrite them.

Impact

Loss of protocol-native assets.

Tools Used

Manual review

Recommendations

Increase instead of overwriting

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

`L2ContractMigrationFacet` overwrites user's deposit, instead of increasing it

Appeal created

deadrosesxyz Submitter
about 1 year ago
giovannidisiena Auditor
about 1 year ago
giovannidisiena Auditor
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`L2ContractMigrationFacet` overwrites user's deposit, instead of increasing it

Support

FAQs

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