Skip to content
Business logic Audit finding Intermediate

Owner can call applyCover multiple times in PoolTemplate.sol

The applyCover function lacks a check that the market is in a Trading state, allowing the owner to call it repeatedly and extend the insurance period indefinitely, preventing the market from resuming. This also enables the owner to emit fraudulent MarketStatusChanged events.

camden Follow

Originally disclosed on Code4rena

Submitted by camden

The owner could potentially extend the insurance period indefinitely in the applyCover function without ever allowing the market to resume. This is because there is no check in applyCover to ensure that the market is in a Trading state.

This can also allow the owner to emit fraudulent MarketStatusChanged events.

Recommended Mitigation Steps

Require that the market be in a Trading state to allow another applyCover call.

oishun1112 (Insure) confirmed and resolved:

this behaviour is not intended, so confirmed.

0xean (judge) commented:

upgrading to medium severity since it alters the function of the protocol

2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.

The original report as published on Code4rena, by camden. 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 applyCover function does not verify that the market is in a Trading state before allowing the owner to apply coverage.

Impact

The owner could indefinitely extend the insurance period, preventing the market from resuming normal operation and emitting fraudulent events.

What the attacker needed

Owner privileges

The fix

The fix should require that the market be in a Trading state before allowing another applyCover call.

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 a smart contract, certain functions should only work when the contract is in a specific state, like 'Trading'. Here, the function that applies insurance coverage can be called even when the market is not trading, so the owner can keep extending the coverage period and the market never restarts. This is a problem because it breaks the intended flow of 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.

More by camden

View all

5 more disclosed reports, best first.

More from InsureDAO contest

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.