The _update function calls an external contract (IPerpsEngine) before updating the state. This can allow the external contract to reenter the function and potentially manipulate the state.
Here is the vulnerability present
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/account-nft/AccountNFT.sol
Calling an external contract before updating the state can lead to reentrancy attacks, where the external contract can call back into the vulnerable function before the state is updated.
Update the state before calling the external contract to prevent reentrancy attacks.
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.