Open sherlock-admin3 opened 4 months ago
1 comment(s) were left on this issue during the judging contest.
0xmystery commented:
Rewards are not correctly calculated
The protocol team fixed this issue in the following PRs/commits: https://github.com/allora-network/allora-chain/pull/424
Escalate
This is different from #74 and wasn't fixed by https://github.com/allora-network/allora-chain/pull/424.
Escalate
This is different from #74 and wasn't fixed by https://github.com/allora-network/allora-chain/pull/424.
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
This report is different from #74 and shouldn't be a duplicate.
I agree it's not a duplicate of #74, but as I understand the only impact here is only that the invariant from the README is broken. Hence, it warrants medium severity, based on the following rule:
The protocol team can use the README (and only the README) to define language that indicates the codebase's restrictions and/or expected functionality. Issues that break these statements, irrespective of whether the impact is low/unknown, will be assigned Medium severity. High severity will be applied only if the issue falls into the High severity category in the judging guidelines
Planning to accept the escalation and make it a separate medium-severity bug. @mystery0x @imsrybr0 are there any duplicates?
Hi @WangSecurity,
As far as I can tell, I couldn't find a similar report. Maybe I'm missing something, waiting for @mystery0x confirmation.
@WangSecurity
Hi @mystery0x, #127 is a duplicate of #74.
As I understand, the problem with both reports is that the untrimmed amount is used, when the trimmed amount is sent. It may seem similar but these are not duplicates based on the code implementation and how and where the issue happens. In that case, I agree that #127 is a duplicate of #74, not the duplicate of this issue.
Result: Medium Unique
imsrybr0
Medium
Broken invariant : the sum of all (delegateRewardsPerShare * delegated stake - reward debt) = the balance of the /x/bank AlloraPendingRewardForDelegatorAccountName module account when when distributing delegate stakers rewards
Summary
Broken invariant : the sum of all (delegateRewardsPerShare * delegated stake - reward debt) = the balance of the /x/bank AlloraPendingRewardForDelegatorAccountName module account when distributing delegate stakers rewards
Vulnerability Detail
When distributing delegate stakers, the reward debt in increased by the full untrimmed amount while only the trimmed amount is sent to the delegate staker.
Additionally, if the pending reward amount is less than 1, the reward debt will still be increased while no rewards are sent.
Impact
AlloraPendingRewardForDelegatorAccountName will end up holding more than the amount owed.
Code Snippet
RewardDelegateStake
Tool used
Manual Review
Recommendation