Inconsistency in view functions can lead to users believing they’re due for more BKD rewards
The view functions for checking claimable rewards are inconsistent: one function includes an inflation recipient's share while others do not. A user could see a larger claimable amount than they actually receive.
Submitted by SmartSek
Impact
The view functions used for a user to check their claimable rewards vary in their implementation. This can cause users to believe they are due X amount but will receive Y.
Proof of Concept
If the inflationRecipient is set, then poolStakedIntegral will be incremented in claimableRewards() but not in any other function like allClaimableRewards() or poolCheckpoint().
If a user calls claimableRewards() after the inflationRepient has been set, claimableRewards() will return a larger value than allClaimableRewards() or the amount actually returned by claimRewards().
Recommended Mitigation Steps
To make the logic consistent, claimableRewards() needs if (inflationRecipient == address(0)) added to it.
chase-manning (Backd) confirmed
Alex the Entreprenerd (judge) commented:
The warden has identified an incorrect implementation in how rewards are shown, while no assets are at risk, the issue identified is a programming mistake that could cause further issues.
For this reason I agree with Medium Severity
I’m still fairly conflicted on severity as the impact is going to be quite small, however at this time, because the “code is wrong”, I still think Medium Severity to be valid.
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
Likely the claimableRewards() function fails to check whether the inflationRecipient is set, so it includes an extra increment that other reward-viewing functions omit.
Impact
Users could be misled about their claimable rewards, but no assets are at risk according to the judge.
What the attacker needed
InflationRecipient is set
The fix
The claimableRewards() function should be changed to include the same condition on inflationRecipient as the other functions.
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.
Smart contracts often have 'view' functions that just read and show information without changing anything. Here, one such function calculates rewards differently from the others, so it can display a higher number than what the user will actually get when claiming.
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.