AAVE Exploit: So Easy That it’s Hard Not To Hack
A flaw in the AaveBoost contract allowed an attacker to make repeated zero-amount deposits and still receive a fixed reward of 0.3 Aave tokens each time. By repeating this 163 times, the attacker obtained about 48.9 Aave tokens and then withdrew them.
medium.com
Published on medium.com
Aave is a DeFi lending protocol that allows lending and borrowing crypto assets using variable and stable interest rates. It is one of the largest DeFi lending platforms in the crypto market.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the reward logic checked the contract's own token balance rather than the actual deposit amount, so a zero deposit still triggered the reward payout.
Impact
The attacker could obtain about 48.9 Aave tokens from the protocol through repeated zero deposits.
What the attacker needed
Ability to deploy a smart contract; AaveBoost contract holds enough Aave tokens; no special permissions needed
How it was found
- The attacker deployed a malicious contract in advance.
- The attacker called a function on that contract, passing the AaveBoost address, the Aave token address, a bribe token address, the AavePool address, and a number.
- The malicious contract called proxyDeposit on AaveBoost with a zero amount.
- Because the contract's Aave balance was above the reward threshold, the code added the reward to the zero amount and deposited that total into AavePool.
- The attacker repeated this zero deposit 163 times, each time receiving 0.3 Aave tokens as a reward.
- The attacker then called withdraw to move the accumulated tokens first to the attacking contract and then to their own address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A smart contract is a program that runs on a blockchain and can hold money. In this case, a contract meant to give a reward for deposits had a bug: it paid the reward even when the deposit was zero. The attacker simply called the deposit function many times with zero, collected the rewards, and took the money out.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.