Summary
The function approveCollateralTokenForAave in AaveDIVAWrapper.sol lacks proper access control, allowing any user to call it and approve collateral tokens for the Aave V3 Pool. This oversight enables unauthorized approvals, increasing the risk of front-running attacks, token hijacking, and fund mismanagement. Given that _approveCollateralTokenForAave may set unlimited allowances, attackers can potentially manipulate this function to drain protocol-owned tokens or interfere with legitimate transactions.
This function does not have any access control (onlyOwner or onlyAuthorized), meaning any external user can call it.
_approveCollateralTokenForAave likely uses safeApprove or safeIncreaseAllowance, granting unlimited approvals for the Aave V3 Pool.
Since approvals are set at the contract level, a malicious or unauthorized approval could lead to fund mismanagement or loss.
Condition: If _approveCollateralTokenForAave sets an unlimited token approval for Aave V3 without first setting it to zero, an attacker can exploit this to front-run legitimate transactions.
User A initiates a deposit into the contract, requiring the contract to approve a collateral token for Aave V3.
Attacker B monitors the mempool and quickly calls approveCollateralTokenForAave(_collateralToken) for the same token before the user’s transaction is mined.
Since the function lacks an onlyOwner check, the attacker can modify the approval settings, potentially allowing another contract to withdraw tokens from the protocol.
Once the approval is in place, the attacker’s contract immediately transfers out the approved tokens before the protocol or user can interact with them.
Protocol or user funds can be drained before legitimate deposits are processed.
The approval remains valid for future unauthorized transactions, allowing continuous exploitation.
Condition: If _approveCollateralTokenForAave does not restrict approvals to safe or whitelisted contracts, an attacker can approve a contract they control to receive collateral funds.
Attacker C calls approveCollateralTokenForAave(_collateralToken), which grants approval for Aave V3.
However, Aave does not immediately use the approved tokens—they remain under contract control until explicitly transferred.
Instead of Aave, the attacker can deploy a contract that mimics Aave’s function calls.
The attacker calls the malicious contract, which then triggers token transfers from the wrapper contract to an unauthorized address.
The protocol unknowingly allows malicious interactions by blindly approving all tokens.
Attackers withdraw protocol-held assets to their own accounts.
There is no way to revert lost funds once they have been transferred.
Loss of Funds: Attackers can exploit unrestricted approvals to drain protocol assets.
Manipulation of Token Approvals: Malicious actors can repeatedly set arbitrary approvals.
Breakdown of Trust: Users will lose confidence if approvals can be modified by anyone, exposing their funds to unauthorized access.
This PoC demonstrates how an attacker can manipulate the approval system and front-run legitimate transactions to extract protocol funds.
The attacker deploys the malicious contract and calls exploitApproval().
The wrapper contract approves tokens for Aave V3 without verifying the caller.
The attacker immediately transfers the approved tokens to themselves.
The protocol loses funds with no way to recover them.
onlyOwner ModifierRestricting the function ensures only the contract owner or admin can modify collateral approvals.
✅ Prevents unauthorized approvals
✅ Eliminates the risk of arbitrary approvals
✅ Ensures only trusted parties can modify token settings
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.