Fees are taken on risk collateral
The withdrawal function charges a fee on the entire collateral deposited by risk users, not just on premiums and payouts. This could discourage risk users from providing collateral because fees may exceed their profits.
Submitted by 0x52
Fees are taken on funds deposited as collateral.
Proof of Concept
uint256 feeValue = calculateWithdrawalFeeValue(entitledShares, id);
In L226 of Vault.sol#withdraw the fee is taken on the entire collateral deposited by the risk users. This is problematic for two reasons. The first is that the collateral provided by the risk users will likely be many many times higher than the premium being paid by the hedge users. This will create a strong disincentive to use the protocol because it is likely a large portion of the profits will be taken by fees and the risk user may unexpectedly lose funds overall if premiums are too low.
The second issue is that this method of fees directly contradicts project documents which clearly indicate that fees are only taken on the premium and insurance payouts, not when risk users are receiving their collateral back.
Recommended Mitigation Steps
Fee calculations should be restructured to only take fees on premiums and insurance payouts.
MiguelBits (Y2K Finance) disputed
Agree with the warden. If the withdrawal fee exceeds the premium paid, risk users are disincentivised to provide collateral.
The second issue is that this method of fees directly contradicts project documents which clearly indicate that fees are only taken on the premium and insurance payouts, not when risk users are receiving their collateral back.
Not sure if the warden is referring to the fee as the trading fee
cin the article, but I would agree if it’s the case. Implementation isn’t according to spec. The actual fees charged might be more than expected.
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 withdrawal fee is calculated on the full collateral amount rather than only on premiums and insurance payouts, contrary to the project's documentation.
Impact
Risk users could lose a large portion of their profits to fees and may even lose funds overall if premiums are too low, creating a strong disincentive to provide collateral.
What the attacker needed
Risk user provides collateral; risk user withdraws collateral
The fix
Fee calculations should be restructured to only take fees on premiums and insurance payouts.
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 this protocol, risk users put up collateral and hedge users pay premiums. The code takes a fee from the whole collateral when risk users withdraw, instead of only from the premiums and payouts. That means risk users might pay more in fees than they earn, so they may stop using the protocol.
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.