Skip to content
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

DOS WITH BLOCK GAS LIMIT IS POSSIBLE AT getInflationAmt() #713

Closed
code423n4 opened this issue Jan 3, 2023 · 9 comments
Closed

DOS WITH BLOCK GAS LIMIT IS POSSIBLE AT getInflationAmt() #713

code423n4 opened this issue Jan 3, 2023 · 9 comments
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue duplicate-360 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor duplicate Sponsor deemed duplicate

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/RewardsPool.sol#L74

Vulnerability details

getInflationAmt() is a public function and it contains the following unbounded for loop:

for (uint256 i = 0; i < inflationIntervalsElapsed; i++) {

It is an unbounded loop, depending on the inflation intervals
If inflationIntervalsElapsed is big enough, block gas limit may be hit.

Recommended Mitigation Steps

Limit the max number of loop iterations to prevent hitting block gas limit.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jan 3, 2023
code423n4 added a commit that referenced this issue Jan 3, 2023
@GalloDaSballo
Copy link

Loop costs less than 100 gas per iteration, this looks off

C4-Staff added a commit that referenced this issue Jan 6, 2023
@emersoncloud
Copy link

duplicate of #652

@emersoncloud emersoncloud added the sponsor duplicate Sponsor deemed duplicate label Jan 17, 2023
@0xju1ie
Copy link

0xju1ie commented Jan 18, 2023

dupe of #139

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as duplicate of #139

@GalloDaSballo
Copy link

Awarding 25% due to very poor description

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as partial-25

@c4-judge c4-judge added the partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) label Jan 26, 2023
@c4-judge c4-judge reopened this Jan 29, 2023
@c4-judge c4-judge removed partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) duplicate-139 labels Jan 29, 2023
@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as not a duplicate

@c4-judge c4-judge added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax downgraded by judge Judge downgraded the risk level of this issue duplicate-360 and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jan 29, 2023
@c4-judge
Copy link
Contributor

Duplicate of #360

@GalloDaSballo
Copy link

L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue duplicate-360 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor duplicate Sponsor deemed duplicate
Projects
None yet
Development

No branches or pull requests

5 participants