Skip to content
Business logic Audit finding Intermediate

A user can pay less in fees by vouching initially with a smaller amount and then using the `EthosVouch::increaseVouch` function to add the remaining vouch value

The EthosVouch fee mechanism allows a user to reduce fees by initially vouching a smaller amount and then repeatedly calling increaseVouch, because the user becomes an existing voucher and receives part of the vouchersPoolFee on each increase. This lets the user reclaim a portion of the fee, reducing total fees paid and causing other vouchers to lose expected fee revenue.

0xKann Follow with 0xPhantom2, Bbash and 15 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-ethos-network-ii-judging/issues/714

Found by

0xKann, 0xPhantom2, Bbash, BengalCatBalu, John44, POB, Pheonix, Ryonen, SovaSlava, X12, debugging3, mahdikarimi, moray5554, shui, t0x1c, tachida2k, tjonair, zxriptor

Summary

A vulnerability in the EthosVouch fee mechanism allows users to reduce fees when vouching for a subject. By splitting their vouching process into multiple smaller transactions, users can partially reclaim vouchersPoolFee, resulting in significantly lower total fees compared to a single large transaction. This exploit undermines the intended fee structure and results in financial losses for other previous vouchers.

Root Cause

The vouchersPoolFee is redistributed to existing vouchers. By vouching with a smaller value initially, a user becomes an existing voucher and subsequently benefits from vouchersPoolFee in subsequent EthosVouch::increaseVouch calls. The logic does not distinguish between fees for new vouches and subsequent increases, enabling fee circumvention.

Internal pre-conditions

None

External pre-conditions

  1. There is at least one other existing voucher to receive part of the vouchersPoolFee.

Attack Path

  1. A user initially vouches with a smaller value (e.g., 10 ETH instead of the intended 100 ETH).
  2. The user becomes an existing voucher and receives part of the vouchersPoolFee.
  3. The user repeatedly calls increaseVouch in smaller increments (e.g., 10 ETH per transaction) to reach the intended total vouch value.
  4. In each increaseVouch call, the user reclaims part of the vouchersPoolFee, significantly reducing the total fees paid.

Impact

  1. Existing vouchers lose part of the intended fee revenue. In the provided example, the user saves approximately 2.54 ETH in fees for a 100 ETH vouch.

PoC

Example: User A wants to vouch with 100 ETH for a subject S. User B has already vouched with 1 ETH for that subject. The fees are defined as follows:

  • entryProtocolFeeBasisPoints = 100 (1%)
  • entryDonationFeeBasisPoints = 200 (2%)
  • entryVouchersPoolFeeBasisPoints = 300 (3%)

If User A simply calls the EthosVouch::vouchByProfileId function with a msg.value of 100 ETH, they will pay approximately 0.99 ETH to the protocol, 1.96 ETH to the subject S, and 2.91 ETH to User B (the only previous voucher). This means they will pay a total of around 5.86 ETH in fees, and their vouch balance will be 94.14 ETH.

However, if User A wants to pay fewer fees, they can call the EthosVouch::vouchByProfileId function with a msg.value of 10 ETH and then call the EthosVouch::increaseVouch function nine more times, each with 10 ETH. By doing this, User A becomes a previous voucher and receives part of the vouchersPoolFee. In the end, their vouch balance will be approximately 96.68 ETH, meaning they paid 2.54 ETH less in fees (5.86 ETH - 3.32 ETH) compared to the first case.

Note: On-chain fees are excluded from the calculations, but they are much lower than the protocol fees.

Mitigation

Exclude the vouching user from receiving vouchersPoolFee during their own transactions

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/trust-ethos/ethos/pull/2242

The original report as published on Sherlock, by 0xKann. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

The fee logic does not exclude the vouching user from receiving a share of the vouchersPoolFee when they increase their own vouch, so they can reclaim part of the fee.

Impact

Existing vouchers lose part of the intended fee revenue; in the example, the user saves approximately 2.54 ETH in fees for a 100 ETH vouch.

What the attacker needed

At least one other existing voucher

The fix

The protocol team fixed this issue by excluding the vouching user from receiving vouchersPoolFee during their own transactions.

How it was found

  1. User initially vouches with a smaller amount (e.g., 10 ETH instead of 100 ETH).
  2. User becomes an existing voucher and receives part of the vouchersPoolFee.
  3. User repeatedly calls increaseVouch in smaller increments (e.g., 10 ETH per transaction) to reach the intended total vouch value.
  4. In each increaseVouch call, the user reclaims part of the vouchersPoolFee, reducing total fees paid.

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.

When you vouch (deposit) for someone, you pay a fee. Part of that fee goes to people who already vouched. The bug is that if you first vouch a small amount, you become one of those people, so when you add more money later, you get a cut of your own fee back. This means you pay less overall, and the other people get less than they should.

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 Ethos Network Financial Contracts

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.