# Rewards can disappear when new rewards are distributed in the RewardsController.

RewardsController.config resets reward start time, dropping fixed borrow shares before new start from accountFixedBorrowShares, so unclaimed borrower rewards vanish.

- Payout: Contest reward
- Severity: medium
- Program: Interest Rate Model
- Credited: 0x73696d616f
- Disclosed: 2024-04-06
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-04-interest-rate-model-judging/issues/95
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AM-7
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:regression technique:source-review vuln:business-logic vuln:reward-distribution

**Target:** RewardsController reward distribution config
**Root cause:** accountFixedBorrowShares and previewAllocation compute fixed borrow shares starting from rewardData.start; when admin updates start to a future time, fixed positions with maturity before the new start are excluded from the borrower's balance, so their previously accrued rewards are never counted.
**Steps:**
1. Deploy protocol with USDC market and opRewardAsset; set reward config start=0, distributionPeriod=12 weeks.
2. ALICE and BOB each deposit 50 ether and borrowAtMaturity at 4, 12, 16 weeks.
3. Warp to 18 weeks; both have equal allClaimable (~999999975000000000000).
4. BOB calls claimAll(BOB) and receives full rewards.
5. Admin mints 4000 ether rewards and calls config with new start=block.timestamp, distributionPeriod=12 weeks.
6. ALICE calls claimAll(ALICE); her balance is only ~734619963000000000000 because fixed borrow shares before the new start are excluded.
**How found:** Code review of config() updating rewardData.start and accountFixedBorrowShares()/previewAllocation() using start to bound fixed maturity iteration; noticed fixed positions before new start are skipped, then wrote a Foundry test comparing BOB (claimed early) vs ALICE (claimed after config reset).
**Exploitation:** No attacker; admin action of scheduling new rewards with a later start time causes unclaimed rewards for borrowers with fixed positions maturing before the new start to be silently dropped from their claimable balance.
**Insight:** When a reward index is parameterized by a mutable start time, check whether changing that start retroactively excludes positions whose maturity falls before it; test claim-before vs claim-after config updates for the same position set.
