Closed sherlock-admin2 closed 1 year ago
3 comment(s) were left on this issue during the judging contest.
shogoki commented:
Transactions are atomic
0xyPhilic commented:
invalid because takeCollateral can't be called by external third person
Kral01 commented:
this is not the issue
feelereth
high
Front-running vulnerability in the liquidate function
Summary
As liquidate involves multiple transactions, an attacker could watch for pending liquidations and front run to steal some collateral
Vulnerability Detail
The key issue is that liquidate makes multiple state-changing transactions in sequence:
Impact
An attacker can steal collateral rewards
Code Snippet
https://github.com/sherlock-audit/2023-07-blueberry/blob/main/blueberry-core/contracts/BlueBerryBank.sol#L544-L628
Tool used
Manual Review
Recommendation
Use a "state" variable to gate access to sensitive logic