while importing from Prb library as below
the library has some rules that are to be followed ie
However, there is no check to ensure the segment duration is never 0. If the segment duration becomes zero due to certain conditions or configurations, a division by zero error could occur during the calculation process. This would result in transaction revert, disrupting the contract's normal operation and potentially causing financial loss.
Division by zero errors
(PoC):
The vulnerability arises when the segment duration (segmentDuration) becomes zero.
For instance, if the timestamps used to calculate segment duration end up being equal, the division operation elapsedTime.div(segmentDuration) would result in a division by zero error.
manual Review
Input Validation: Ensure that segment durations are always non-zero when configuring segments.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.