denominators can be set to 0 #493
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
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 fromFile 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 zeroThe text was updated successfully, but these errors were encountered: