Open c4-bot-2 opened 10 months ago
0xSorryNotSorry marked the issue as sufficient quality report
0xSorryNotSorry marked the issue as duplicate of #1103
Trumpero changed the severity to QA (Quality Assurance)
Trumpero marked the issue as grade-b
Trumpero marked the issue as grade-a
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/ProfitManager.sol#L292
Vulnerability details
Impact
Upon ProfitManager receiving rewards from the lending interest payment, these "rewards" are sent to various recipients, such as surplusBuffer, GuildHolders, Credit rebase rewards and others. The issue arises if rewards are assigned to guild voters, however, there are NO guild holders who are voting for that gauge, this means that the credit token reward is NOT assigned anywhere, generating a small inflation of the credit token.
In addition, there is a comment mentioning that those profits are not assigned to the gauge if there are no voters, however the credit reward is not assigned or burned, keeping a not updated credit token:
There is a possibility that all guild voters have left the gauge (remove votes), then there is a repayment of a loan, causing the credit token reward assigned to the guild voters NOT to be distributed and to remain NOT assigned within the
ProfitManager
contract.Proof of Concept
The next test shows how
gauge1
has votes fromAlice
, howeverAlice
withdraws her votes, thenProfitManager
obtains a profit however that profit remains NOT assigned within theProfitManager
contract. Test steps:gauge1
.gauge1
.profitManager
.Tools used
Manual review
Recommended Mitigation Steps
A
guild
that does not have any voters who will receive profits should assign those rewards to surplusBuffer or burn those credit tokens:Assessed type
Context