Skip to content
Business logic Audit finding Intermediate

Incorrect initialization gives IL protection of only 1 second instead of 100 days in Router.sol

The contract initialised the impermanent loss protection period to one second instead of the hundred days described in the comments and specification. Unless the parameter was later reset, users would receive full protection almost immediately rather than accruing it over a hundred days, undermining the protocol's stated protection model.

Vader Protocol contest

Originally disclosed on Code4rena

Incorrect initialization of timeForFullProtection to 1 sec instead of 8640000 secs (100 days) as indicated in code comments, appears to be a test setting mistakenly carried over for deployment. Therefore, unless timeForFullProtection is reset to 100 days by setParams() (calling this function is a missing functionality in the DAO currently), the Impermanent Loss (IL) protection “rule” of 100 days will not apply in Utils.getProtection().

This breaks a key value proposition of the Vader protocol which is IL protection as indicated in the specification:

“Impermanent Loss Protection: The deposit value for each member is recorded when they deposit. When they go to withdraw, the redemption value is computed. If it is less than the deposit value, the member is paid the deficit from the reserve. The protection issued increases from 0 to 100% linearly for 100 days.”

Recommend changing to “timeForFullProtection = 8640000; //100 days” on L84

strictly-scarce (vader) disputed:

It’s deliberately set to 1 second to conduct adequate testing.

The original report as published on Code4rena. 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 a test value for the protection period was left in the deployed initialisation instead of the intended hundred-day value.

Impact

The hundred-day impermanent loss protection rule would not apply, so the protocol's core protection promise would be broken unless the parameter was reset through a function the DAO could not yet call.

What the attacker needed

Deployed contract with default params

The fix

The value should be changed to the hundred-day constant in the initialisation, though the project disputed the finding as a deliberate testing setting.

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.

Impermanent loss is the money a liquidity provider can lose when the price of the tokens they deposited moves apart. The protocol promises to slowly pay that loss back over a hundred days, but the setting that controls how long that takes was set to one second. That means the protection would kick in almost instantly instead of building up gradually, which is not what the design intended.

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 from Vader Protocol 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.