# `RewardManagerMixin.claimAccountRewards` lacks of necessary param check.

claimAccountRewards lacks account validation, letting anyone pass MORPHO's address to redirect vault reward tokens to the Morpho contract instead of users.

- Payout: Audit contest
- Severity: high
- Program: Notional
- Found by: Bluedragon
- Disclosed: 2025-06-27
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/624
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-06-notional-exponent%3AH-7
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** RewardManagerMixin.claimAccountRewards reward claim function
**Root cause:** claimAccountRewards is callable by anyone and accepts an arbitrary account param; when caller is not a lending router it computes sharesHeld via balanceOf(account) with no validation that account is a legitimate reward holder.
**Steps:**
1. Call `AbstractLendingRouter.enterPosition` so vaultToken is minted and transferred to MORPHO, increasing MORPHO's vaultToken balance.
2. From any address, call `RewardManagerMixin.claimAccountRewards(MORPHO, type(uint256).max)`.
3. Since msg.sender is not a lending router, sharesHeld = balanceOf(MORPHO), and rewards are transferred to MORPHO.
4. Observe rewardToken/emissionsToken balances credited to MORPHO instead of real users.
**How found:** Code review of claimAccountRewards noticed the account param is unvalidated and that balanceOf(account) is used when caller isn't a lending router; recognized MORPHO accumulates vaultToken balances via enterPosition, making it a profitable target address.
**Exploitation:** Attacker (or anyone) invokes claimAccountRewards with MORPHO as account; because MORPHO holds most vaultTokens from lending router deposits, the bulk of reward/emission tokens are sent to the MORPHO contract address, denying rewards to legitimate users.
**Insight:** When a claim function derives shares from balanceOf(account) for arbitrary callers, check whether any contract address (e.g. a lending pool holding collateral tokens) accumulates large balances that would siphon rewards if passed as account.

## Proof of concept (copied exactly from the original report)

**Test calling claimAccountRewards with MORPHO as account**

```
vm.startPrank(address(0xa1a2bbccddeeff));
+        RewardManagerMixin(address(rm)).claimAccountRewards(address(0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb), type(uint256).max);
+        vm.stopPrank();
         RewardManagerMixin(address(rm)).claimAccountRewards(liquidator, type(uint256).max);
```

