The SablierV2NFTDescriptor contract contains a division operation that lacks a check for zero values in the divisor, potentially causing the function to revert if a zero value is passed as input.
The vulnerability is located in the SablierV2NFTDescriptor.sol
file. Specifically, there is a division operation that uses the depositedAmount
variable as the divisor without verifying that it is non-zero. If depositedAmount
is zero, the function will revert due to a division by zero error.
The impact of this vulnerability is that any call to this function with a depositedAmount
of zero will revert, potentially disrupting the intended functionality and flow of the contract. This can lead to unexpected failures and a poor user experience.
Manual code review
Add a zero check: Implement a check to ensure depositedAmount
is not zero before performing the division. If depositedAmount
is zero, handle the case appropriately, either by returning a default value or by reverting with a clear error message.
Example:
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.