The function distributeProtocolAssetReward
in its current implementation uses safeTransfer
to send tokens to fee recipients. If any of the recipients is a malicious contract, this could potentially lead to a reentrancy attack, where the recipient's fallback function might re-enter the contract and perform unintended operations before the state is updated. This could compromise the contract’s security and functionality.
Reentrancy Attack: The function performs a state-changing operation safeTransfer
by sending tokens to an address. If that address is a contract, it might call back into the contract during its fallback function, leading to a reentrancy vulnerability.
No Reentrancy Guard: The function does not use any reentrancy protection mechanisms, such as the nonReentrant
modifier from OpenZeppelin’s ReentrancyGuard
, which would prevent reentrancy attacks.
If a fee recipient is a malicious contract, it could exploit this vulnerability to manipulate the contract’s state or perform unauthorized actions.
An attacker could drain funds or disrupt the reward distribution process by repeatedly re-entering the contract during the token transfer.
Loss of Protocol Integrity.
Manual code review.
Implement Reentrancy Protection: Use OpenZeppelin's ReentrancyGuard contract to prevent reentrancy attacks by adding the nonReentrant modifier to the 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.