Owner or Managers can rug Aave rewards
The claimRewards function in the AaveV3YieldSource contract allows the owner or manager to send all Aave rewards to any address. A malicious owner or manager could steal rewards intended for PoolTogether users.
Submitted by IllIllI, also found by GimelSec
A malicious owner or manager can steal all Aave rewards that are meant for PoolTogether users.
Even if the user is benevolent the fact that there is a rug vector available may negatively impact the protocol’s reputation.
Proof of Concept
File: contracts/AaveV3YieldSource.sol #X
275 function claimRewards(address _to) external onlyManagerOrOwner returns (bool) {
276 require(_to != address(0), "AaveV3YS/payee-not-zero-address");
277
278 address[] memory _assets = new address[](1);
279 _assets[0] = address(aToken);
280
281 (address[] memory _rewardsList, uint256[] memory _claimedAmounts) = rewardsController
282 .claimAllRewards(_assets, _to);
AaveV3YieldSource.sol#L275-L282
The claimRewards() function allows the caller to send the rewards to an arbitrary address.
Recommended Mitigation Steps
Use a poolAddressesProviderRegistry-like contract to determine where the rewards should go, instead of letting an address be passed in
PierrickGT (PoolTogether) acknowledged and commented:
Governance will own this contract with a multisig that will need 7 signatures out of 11 members before a transaction can be sent, so it limits the possibilities of a rug pull. These rewards are not tokens deposited by the users, so it’s also less of a concern.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The claimRewards function lets the caller choose an arbitrary recipient address for the rewards, without restricting it to the protocol's intended address.
Impact
A malicious owner or manager could steal all Aave rewards meant for users, though the multisig requirement and the fact that rewards are not user deposits may limit the practical risk.
What the attacker needed
Caller is owner or manager
The fix
The rewards destination should be determined by a registry-like contract rather than an address passed in by the caller.
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 report has not been written yet. The Original tab links to the source.
In this smart contract, a privileged user (owner or manager) can call a function that claims rewards and specify any recipient address. This means they could direct all rewards to themselves instead of the intended users. The report points out that this creates a risk of theft by insiders.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.