The LiquidationKeeper contract has a potential reentrancy risk in the performUpkeep function during the external call to perpsEngine.liquidateAccounts().
In the performUpkeep function :
The external call to perpsEngine.liquidateAccounts() is made without any reentrancy protection. A malicious contract could exploit this vulnerability to re-execute performUpkeep before the first execution completes.
Unintended multiple liquidations of the same account
Potential manipulation of system state
Risk of fund loss if liquidation logic can be exploited recursively
Possible disruption of the liquidation mechanism
Manual code review
Slither
Mythril
Add OpenZeppelin's nonReentrant modifier :
Follow the Checks-Effects-Interactions pattern:
Perform all validations first
Update contract state
Make external calls last
3.Consider implementing additional safety measures:
Add a circuit breaker mechanism
Implement rate limiting for liquidations
Add comprehensive event logging for better monitoring
These modifications will secure the function against reentrancy attacks and improve operation traceability.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.