20,000 USDC
View results
Submission Details
Severity: high

seizeLoan() and repay() can rearrange the index of arrays

Summary

seizeLoan() and repay() can rearrange the index of arrays

Vulnerability Details

seizeLoan() and repay() both have this line:

delete loans[loanId]
`
Because of this, the index of the array `loans` got reorder, making all the ids after is not at right intended index of the array
## Impact
Bacause of this, users who got the transaction already in the mempool, or user who call it itself, or users who is not acknowledge the change of the reorders, can accidentally make action to wrong intention id, causing losing token
## Tools Used
Manual review
## Recommendations
Use mapping

Support

FAQs

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