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

Buoy3Pool._updateRatios unsafe math #105

Open
code423n4 opened this issue Jul 7, 2021 · 2 comments
Open

Buoy3Pool._updateRatios unsafe math #105

code423n4 opened this issue Jul 7, 2021 · 2 comments
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

The function performs type conversions and subtraction without over-/underflow checks:

uint256 check = abs(int256(_ratio) - int256(chainRatios[i].div(CHAIN_FACTOR)));

Recommended Mitigation Steps

We recommend checking if the values fit within the type range first, otherwise revert with a meaningful error message, as well as checking for underflows.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jul 7, 2021
code423n4 added a commit that referenced this issue Jul 7, 2021
@kitty-the-kat kitty-the-kat added the duplicate This issue or pull request already exists label Jul 14, 2021
@kitty-the-kat
Copy link
Collaborator

#6

@ghoul-sol
Copy link
Collaborator

ghoul-sol commented Jul 25, 2021

This is partially a duplicate of #6 but it focuses on low risk issue so I'll record is as a separate (low risk) issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants