-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users can frontrun ProfitManager.notifyPnL to avoid losses or claim rewards. #906
Comments
0xSorryNotSorry marked the issue as sufficient quality report |
0xSorryNotSorry marked the issue as primary issue |
0xSorryNotSorry marked the issue as duplicate of #877 |
Partial duplicate of #994 |
Trumpero marked the issue as not a duplicate |
Trumpero marked the issue as duplicate of #994 |
Trumpero marked the issue as unsatisfactory: |
Trumpero marked the issue as satisfactory |
Hey, @Trumpero, This issue doesn’t show the real impact mentioned in the #994 The only impact which is common for both reports is this line: “In addition, when interest is incurred due to user repays or bids, the user can frontrun the transaction to increment to the gauge and decrement as soon as getting the reward.” The whole report clearly emphasizes the notifyPnL frontrun part which means it is a duplicate of #877 Thanks for your time. |
Trumpero marked the issue as partial-50 |
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/ProfitManager.sol#L292-L405
Vulnerability details
Impact
ProfitManager.notifyPnL is used to distribute rewards or notify gauge loss.
When amount is less than 0, it will notify gauge losse and users will lose the guild tokens incremented to the gauge. And in SurplusGuildMinter, users also lose pledged credit tokens.
When amount is greater than 0, the reward is distributed.
And since the protocol does not implement a locking mechanism, users can add or remove tokens at any time.
This allows users to frontrun ProfitManager.notifyPnL to avoid losing or claiming rewards.
For example, since the auction is linear and bad debts are only generated after the midpoint which makes pnl negative, users can avoid losses by unstaking tokens from SurplusGuildMinter in advance of the midpoint.
In addition, when interest is incurred due to user repays or bids, the user can frontrun the transaction to increment to the gauge and decrement as soon as getting the reward.
Proof of Concept
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/ProfitManager.sol#L292-L405
Tools Used
None
Recommended Mitigation Steps
It is recommended that instead of allowing the user to make immediate exit, the user would be required to make a exit request and would be allowed to exit after a period, and then the exit would only be allowed within a limited time frame.
Assessed type
Context
The text was updated successfully, but these errors were encountered: