A reentrancy attack can be performed if the reward token is updated to be an ERC777 token.
Impact
Low
Vulnerability Detail
A lack of reentrancy preventions allow users to reenter relevant protocol functions, such as claimRewards() in BasePool.sol, or withdraw() in TimeLockPool.sol .
If the reward token is updated to be an ERC777 token in the future (which has support for hooks), a malicious party could re-enter the function that performed the token transfer by calling the function transferring the tokens again in the ERC777 hook.
Especially in claimRewards(), where users obtain the rewards corresponding to their staking amount, the transfer could call a callback triggering an attacker's malicious contract function where claimRewards() could be called again.
Add reentrancy guards to functions transferring reward tokens back from the protocol (claimRewards() in BasePool.sol, or withdraw() in TimeLockPool.sol) (see ReentrancyGuard.sol)
apajaresaguilera
low
Prevent reentrancy
Summary
A reentrancy attack can be performed if the reward token is updated to be an ERC777 token.
Impact
Low
Vulnerability Detail
A lack of reentrancy preventions allow users to reenter relevant protocol functions, such as
claimRewards()
in BasePool.sol, orwithdraw()
in TimeLockPool.sol . If the reward token is updated to be an ERC777 token in the future (which has support for hooks), a malicious party could re-enter the function that performed the token transfer by calling the function transferring the tokens again in the ERC777 hook. Especially inclaimRewards()
, where users obtain the rewards corresponding to their staking amount, the transfer could call a callback triggering an attacker's malicious contract function whereclaimRewards()
could be called again.Code Snippet
Tool used
Manual Review
Recommendation
Add reentrancy guards to functions transferring reward tokens back from the protocol (
claimRewards()
in BasePool.sol, orwithdraw()
in TimeLockPool.sol) (see ReentrancyGuard.sol)