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

denominators can be set to 0 #493

Closed
code423n4 opened this issue Jan 19, 2023 · 2 comments
Closed

denominators can be set to 0 #493

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

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-01-astaria/blob/main/src/AstariaRouter.sol#L295
https://github.com/code-423n4/2023-01-astaria/blob/main/src/AstariaRouter.sol#L303
https://github.com/code-423n4/2023-01-astaria/blob/main/src/AstariaRouter.sol#L311

Vulnerability details

In _file of AstariaRouter.sol, there are multiple places where “denominator” values can be set from File calldata incoming.

Impact

When such denominators are set to 0, either accidentally or intentionally, many of the protocol functionalities will no longer work due to division-by-zero errors.

Proof of Concept

See the attached links

Tools Used

Manual analysis

Recommended Mitigation Steps

Include require statements asserting that denominators cannot be zero

@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 19, 2023
code423n4 added a commit that referenced this issue Jan 19, 2023
@c4-judge
Copy link
Contributor

Picodes marked the issue as duplicate of #101

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

Picodes changed the severity to QA (Quality Assurance)

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-101 grade-b QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants