Incorrect validation during checking liquidity spread #479
Labels
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
M-04
🤖_479_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/PanopticPool.sol#L1483
Vulnerability details
Impact
Because of incorrect validation, it allows option buyers not to pay premium.
Proof of Concept
When long leg is minted or short leg is burnt, the protocol checks liquidity spread by calculating
TotalLiquidity / NetLiquidity
and allows it not exceed9
.However in the check function, the validation is ignored when
NetLiquidity
is zero.This means when a user mints long leg that buys whole selling amount, the liquidity spread is not checked.
This issue allows the option buyer not to pay premium, and here is why:
s_grossPremiumLast
. Refer to_updateSettlementPostMint
function ofPanopticPool
contract._updateSettlementPostBurn
function ofPanopticPool
contract.Since there is no difference in owed premium value, the option buyer will not pay the premium when burning the option.
Tools Used
Manual Review
Recommended Mitigation Steps
When checking liquidity spread, it should revert when N is zero and T is positive:
Assessed type
Context
The text was updated successfully, but these errors were encountered: