The function PerpetualVault::_totalAmount will return 0 if prices.shortTokenPrice.min is 0. This will lead to incorrect values that will impact the whole contract.
PerpetualVault::_totalAmount function contains a division by zero vulnerability. In the else statement, there is no check for prices.shortTokenPrice.minwhether it is 0.
If PerpetualVault::_totalAmountreturns 0 due to the zero division, users will not be able to withdraw their funds. Also when a user deposits in the protocol, the amount of minted shares in PerpetualVault::_mint will be incorrect, because PerpetualVault::_totalAmount returns 0.
-manual review
Adding a check if prices.shortTokenPrice.min is not 0 before the calculation.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.