This report identifies a reentrancy vulnerability within the VaultControllerStrategy.sol::updateDeposits` function, which interacts with the LINK token. The function allows for transferring LINK tokens to a staking pool, which can potentially lead to reentrancy attacks due to the way the ERC-677 LINK token operates.
Reentrancy vulnerability occurs because LINK token, being an ERC-677 token, triggers a callback function on the receiver's contract when a transfer is made. Specifically, this is executed in the line:
The attacker controls the stakingPool or exploits a vulnerable version of it.
The updateDeposits function is called, and it transfers LINK tokens using safeTransfer().
During the transfer, the stakingPool’s onTokenTransfer callback is executed.
Inside the callback, the attacker calls updateDeposits() again before the initial call completes.
This results in inconsistent accounting or fund mismanagement in totalDeposits.
The reentrancy issue can be exploited to:
Manipulate deposit balances
Cause inconsistent accounting.
Manual Review
Use Checks-Effects-Interactions Pattern: Ensure that state updates are done before external calls. Move the update to totalDeposits above the safeTransfer() call.
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.