The KittyPool::whiskdrawMeowllateral
function does not follow the Checks-Effects-Interactions (CEI) pattern, which exposes it to potential reentrancy attacks. In the current implementation, an external call to KittyVault::executeWhiskdrawal
is made before validating the user's collateral with a require statement.
Not adhering to the CEI pattern could allow a malicious actor to exploit the reentrancy vulnerability, potentially draining the contract balance and causing loss of user collaterals.
To mitigate the risk of a reentrancy attack, follow the Checks-Effects-Interactions pattern by first performing all necessary checks, then updating the state, and finally making external calls. Here’s the corrected version of the whiskdrawMeowllateral
function:
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.