Submitted by critical-or-high, also found by Chinmay, Akali, serial-coder, 0xadrii, 0xpiken, and Tendency
The SurplusGuildMinter.getReward() function invokes ProfitManager.claimRewards() that in a loop claims reward through all gauges/terms for SurplusGuildMinter as follows.
Whereas SurplusGuildMinter works with all gauges, and there is no upper limit for the GuildToken.setMaxGauges(max), the length of loop could be unbounded.
Each call to stake(), unstake(), or getReward() of SurplusGuildMinter will either consume excessive amount of gas, or revert with Out-Of-Gas reason after certain number of gauges/terms were added.
Run Poc with the following command:
forge test --mp test/unit/loan/SurplusGuildMinter.t.sol --mt test_dos
Inside SurplusGuildMinter.getReward(user, term) call:
Instead of:
Since the purpose of SurplusGuildMinter.getReward(user, term) is to update the profit index only for a specific term, so there is no need to update profit indexes across all available terms.
DoS
eswak (Ethereum Credit Guild) confirmed via duplicate issue #1110
TrungOre (judge) commented:
btk (warden) commented:
serial-coder (warden) commented:
0xStalin (warden) commented:
serial-coder (warden) commented:
0xStalin (warden) commented:
carrotsmuggler (warden) commented:
TrungOre (judge) commented:
For this audit, 23 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by SBSecurity received the top score from the judge.
The following wardens also submitted reports: beber89, EVDoc, Cosine, 0xbepresent, lsaudit, ether_sky, Bauchibred, deliriusz, tsvetanovv, EloiManuel, ZanyBonzy, Aymen0909, nadin, klau5, 0xaltego, Tendency, Sathish9098, rvierdiiev, HighDuty, hals, grearlake, and Timeless.
