Closed c4-bot-2 closed 11 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-c
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/governance/ProfitManager.sol#L383-L401
Vulnerability details
Impact
Users who hold Guild tokens can vote for certain gauges, this voting mechanism increases the weight of those gauges. If a loan was successfully repaid + interest, the lending term/gauge gains some profit from that repayment process, this profit is distributed into multiple splitters, notice
profitSharingConfig
, one of them is the users who voted for that profited gauge, where each user get a part of that split. This logic is handled innotifyPnL
in theProfitManager
contract, however, this function checks if the profited gauge has a non-zero weight (there are some users who voted) before "registering" the profit for them, but if that gauge has 0 weight that split is not handled and is just thrown away, causing it to be lost and unregistered forever. ( Note we confirmed this with the sponsors )Proof of Concept
Tools Used
Manual review + vscode
Recommended Mitigation Steps
Add an else block that donates that split to any other splitter,
surplusBuffer
for example, something similar to the following:Assessed type
Other