Skip to content
Business logic Audit finding Beginner

Wrong percent for FraxlendPairCore.dirtyLiquidationFee .

The dirty liquidation fee was calculated using a constant of 9000 instead of 90000, so the resulting fee was 9% of the clean fee rather than the intended 90%. This made the fee charged on dirty liquidations far lower than designed.

auditor0517 Follow

Originally disclosed on Code4rena

Submitted by auditor0517, also found by _Adam, 0xA5DF, cccz, minhquanym, minhtrng, and zzzitron

After confirming with the sponsor, dirtyLiquidationFee is 90% of cleanLiquidationFee like the comment.

But it uses 9% (9000 / 1e5 = 0.09) and the fee calculation will be wrong here.

Recommended Mitigation Steps

We should change 9000 to 90000.

dirtyLiquidationFee = (_liquidationFee * 90000) / LIQ_PRECISION; // 90% of clean fee

DrakeEvans (Frax) confirmed and commented:

Confirmed.

gititGoro (judge) commented:

This issue has a great many duplicates. Reason for setting this report as the original:

  1. It’s complete in that it charts the problem and gives a code based mitigation
  2. It’s short and to the point.
  3. The sponsor’s preference was factored in.

The original report as published on Code4rena, by auditor0517. 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 typo in the scaling constant: 9000 was used where 90000 was needed to express 90% against a precision of 1e5.

Impact

Dirty liquidations charged a much smaller fee than intended, so the protocol and lenders received less than the designed penalty.

What the attacker needed

A dirty liquidation occurs

The fix

The constant should be changed from 9000 to 90000 so the dirty fee equals 90% of the clean fee; the sponsor confirmed the issue.

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.

A liquidation fee is a penalty paid when a loan is closed out by someone else. The code meant to set the penalty for a 'dirty' liquidation at 90% of the normal one, but a number in the formula was ten times too small, so the penalty came out at only 9%.

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 auditor0517

View all

11 more disclosed reports, best first.

More from Frax Ether Liquid Staking 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.