Skip to content
Business logic Audit finding Advanced

Incorrect validation during checking liquidity spread

The liquidity spread check in Panoptic's option minting and burning logic is skipped when net liquidity is zero, allowing a buyer to mint a long leg that consumes all selling amount without paying the premium. When the long leg is later burned, the premium is not updated because net liquidity remains zero, so the buyer avoids paying.

KupiaSec Follow

Originally disclosed on Code4rena

Submitted by KupiaSec

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 exceed 9. 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:

  1. When options are minted, last accumulated premium is stored to s_grossPremiumLast. Refer to _updateSettlementPostMint function of PanopticPool contract.
  2. When options are burned, new accumulated premium is fetched and calculates the premium by multiplying liquidity with difference in accumulated premium. Refer to _updateSettlementPostBurn function of PanopticPool contract.
  3. However, when a long leg of T(total liquidity) amount is minted, N becomes zero.
  4. Later, when the minted long leg is burnt, premium values are not updated in SFPM, because N is zero. Refer to SFPM:L1085.

Since there is no difference in owed premium value, the option buyer will not pay the premium when burning the option.

Recommended Mitigation Steps

When checking liquidity spread, it should revert when N is zero and T is positive:

+   if(netLiquidity == 0 && totalLiquidity > 0) revert;
    if(netLiquidity == 0) return;

Assessed type

Context

dyedm1 (Panoptic) confirmed


The original report as published on Code4rena, by KupiaSec. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the liquidity spread validation returns early when net liquidity is zero, even if total liquidity is positive, so the premium update logic is bypassed.

Impact

An option buyer could avoid paying the premium, causing a loss to the protocol or option sellers.

What the attacker needed

Ability to mint and burn options

The fix

The check should revert when net liquidity is zero and total liquidity is positive.

How it was found

  1. Mint a long leg that buys the whole selling amount, making net liquidity zero.
  2. The liquidity spread check is skipped because net liquidity is zero.
  3. Burn the minted long leg; premium values are not updated because net liquidity is still zero.
  4. The option buyer pays no premium.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In options trading, a buyer pays a premium to the seller. This protocol calculates that premium based on liquidity, but a validation gap lets a buyer create a position that uses up all available liquidity without triggering the premium calculation, and later close it without paying. The fix is to reject the zero-liquidity case when there is still total liquidity.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by KupiaSec

View all

28 more disclosed reports, best first.

More from Panoptic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.