Closed sherlock-admin closed 9 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid
Invalid, agree with sponsors comments:
Closing a creditor should be seen as reducing risk (no more flash actions, no more getting debt against the account).
Topmark
medium
Old Owner can take Advantage of updateActionTimestamp Modifier Absence to Front RunAccountV1 contract Against New Owner
Summary
Old Owner can take Advantage of updateActionTimestamp Modifier Absence to front Run closeMarginAccount(...) function call againt Against New Owner
Vulnerability Detail
The modifier provided above shows how updateActionTimestamp is handles, it can be noted in the comment description that oldowner can take advantage of New Owner though Front Running, which is why this modifier is present in many part of the contract by different function calls however the problem is that this modifier is absent in the closeMarginAccount(...) function call which can be taken advantage of by a bad actor in other to create discrepancies for the new owner immediately after transfer of ownership
Impact
Old Owner can Manipulate contract through Frontrunning
Code Snippet
https://github.com/sherlock-audit/2023-12-arcadia/blob/main/accounts-v2/src/accounts/AccountV1.sol#L367 https://github.com/sherlock-audit/2023-12-arcadia/blob/main/accounts-v2/src/accounts/AccountV1.sol#L318 https://github.com/sherlock-audit/2023-12-arcadia/blob/main/accounts-v2/src/accounts/AccountV1.sol#L136 https://github.com/sherlock-audit/2023-12-arcadia/blob/main/accounts-v2/src/accounts/AccountV1.sol#L266
Tool used
Manual Review
Recommendation
The modifer should be added to the closeMarginAccount() function as provided below
Duplicate of #1