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

CvxLocker.findEpochId stops after 128 iterations #53

Open
code423n4 opened this issue Sep 8, 2021 · 0 comments
Open

CvxLocker.findEpochId stops after 128 iterations #53

code423n4 opened this issue Sep 8, 2021 · 0 comments
Labels

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

It's unclear why the binary search algorithm stops after 128 iterations.

Impact

It might not return the actual epoch id (although very unlikely as 128 iterations should be sufficient.)

Recommended Mitigation Steps

Use a while (max > min) loop instead of the for loop with a fixed number of iterations.

uint256 mid = (min + max + 1) / 2; is also not using safe math.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Sep 8, 2021
code423n4 added a commit that referenced this issue Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants