The AaveDIVAWrapperCore
contract exhibits a vulnerability in its token allowance management, particularly when interacting with tokens like USDT that decrement allowance with each transferFrom
operation. The system relies on manual intervention to reset allowances, which can lead to failed deposits if not addressed in time.
Infinite Allowance:
The contract sets an infinite allowance for collateral tokens with the following line of code:
For tokens like USDT that reduce allowance on every transferFrom
, this can lead to allowance depletion over time, causing future deposits to fail.
Manual Fallback Mechanism:
The approveCollateralTokenForAave
function is provided as a fallback to manually reset the allowance:
However, this function must be explicitly called by an external or system actor. If not triggered, the system will encounter deposit failures.
Acknowledgment of Token Behavior:
The contract acknowledges that certain tokens, like USDT, decrement allowance, but no automatic mechanism is implemented to mitigate this behavior:
User Experience:
Deposits can unexpectedly fail when the allowance is exhausted and the fallback function has not been triggered in time.
This affects user trust, particularly for high-value or frequent deposits.
Operational Overhead:
Reliance on manual intervention or system administrator action adds inefficiencies and increases the risk of errors.
Protocol Downtime:
If the allowance is depleted without timely re-approval, the system risks downtime or transaction reverts, potentially affecting a wide range of users.
Manual code review of the AaveDIVAWrapperCore
contract.
Identification of patterns in allowance handling and fallback mechanisms.
Analysis of token behavior (e.g., USDT) for compatibility with infinite allowance.
Automatic Allowance Replenishment:
Implement logic to dynamically reset allowance when it falls below a certain threshold during deposit operations:
Per-Transaction Allowance:
Replace infinite allowances with per-transaction approvals to avoid issues with decrementing allowances:
Periodic Allowance Monitoring:
Use automation (e.g., Chainlink Keepers) to periodically check and reset allowances for tokens with decrementing behavior.
Token-Specific Handling:
Detect and handle tokens like USDT that decrement allowance differently from those that do not.
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.