Skip to content
Business logic Audit finding Beginner

Vault Fees Can Total To More Than 1e18

The vault contract checks each of its four fee types individually against a 1e18 limit, but does not check their sum. An attacker or careless admin could set fees that together exceed 100%, causing users to pay more than intended.

0xNazgul Follow

Originally disclosed on Code4rena

Submitted by 0xNazgul

Currently in Vault.sol there are four different fee types:

  1. Deposit
  2. Withdrawal
  3. Management
  4. Performance

There is a proper check to make sure that individually none of them are >= 1e18. However, they can total to more than 1e18 and cause unsuspecting users to pay more than they may want to.

Proof of Concept

Just taking the deposit and withdrawal fees into account say both of them are set to 5e17, totaling to 1e18. If a user were to then deposit and withdraw, that would be 100%. Add in the other two fees and this situation gets even worse.

Recommended Mitigation Steps

Consider making sure that the total of all four fee types is less than 1e18 instead of individually.

RedVeil (Popcorn) acknowledged


The original report as published on Code4rena, by 0xNazgul. 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 fee validation checks each fee in isolation rather than validating the sum of all fees against a maximum.

Impact

Users could be charged more than 100% in total fees, potentially losing more than their deposit, though the report does not show an actual exploit.

What the attacker needed

Admin sets multiple fees; fees sum above 1e18

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 vault is a smart contract that holds users' funds and charges fees for deposits, withdrawals, and management. The code ensures no single fee is 100% or more, but it never adds them up. So two fees of 50% each could add to 100%, and with other fees the total could exceed what users expect to pay.

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 0xNazgul

View all

6 more disclosed reports, best first.

More from Popcorn 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.