The AaveDIVAWrapperCore contract interacts with external protocols (Aave and DIVA) and performs token transfers without explicit reentrancy protection. Functions like handleTokenOperations, redeemWTokenPrivate, and _claimYield involve external calls and token transfers, which could be exploited in a reentrancy attack. An attacker could repeatedly re-enter the contract during these operations, potentially draining funds or manipulating the contract's state.
The vulnerability arises because the contract does not use reentrancy guards (e.g., OpenZeppelin's ReentrancyGuard
) to protect functions that involve external calls and token transfers. Specifically:
_handleTokenOperations
: Transfers tokens to the contract and interacts with Aave.
_redeemWTokenPrivate
: Burns wTokens and withdraws collateral from Aave.
_claimYield
: Withdraws yield from Aave.
These functions are susceptible to reentrancy attacks because they perform external calls (e.g., Aave interactions) and token transfers without ensuring that the contract's state is updated before the external call.
An attacker deploys a malicious contract that interacts with the AaveDIVAWrapperCore
contract.
The attacker calls a vulnerable function (e.g., redeemWToken
).
During the execution of the vulnerable function, the attacker's contract re-enters the AaveDIVAWrapperCore
contract by calling the same function again.
The reentrancy allows the attacker to repeatedly drain funds or manipulate the contract's state before the original function call completes.
PoC
Funds Theft: An attacker could drain funds from the contract by repeatedly re-entering during token transfers or withdrawals.
State Manipulation: The attacker could manipulate the contract's state (e.g., balances, approvals) to their advantage.
Denial of Service: Repeated reentrancy could cause the contract to run out of gas, leading to denial of service.
Foundry: Used to write and execute the PoC.
Manual Review
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.