You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Admins can set total fees to exceed 10% of BASIS_POINT_SCALE
Summary
An incorrect value for MAX_TOTAL_FEES, allows cumulative fees to exceed the intended 10% of the BASIS_POINT_SCALE. This issue arises because MAX_TOTAL_FEES is set to 10000, representing 100% instead of 10%. Admins can unintentionally (or maliciously) configure fee percentages that result in excessive fees being charged to users.
From doc:
Maximum total fees cannot exceed 10%
Root Cause
In EthosVouch.sol, the MAX_TOTAL_FEES constant is set to 10000 (see here) instead of 1000, which represents 10% of the BASIS_POINT_SCALE. This discrepancy allows cumulative fees (entry protocol fee, exit fee, donation fee, and vouchers pool fee) to reach 100% rather than the intended 10%.
Internal pre-conditions
Admins set the following fee values (as an example, admin can set one fee to 100%):
Entry protocol fee: 5000 basis points (50%).
Donation fee: 2500 basis points (25%).
Vouchers pool fee: 2500 basis points (25%).
The contract incorrectly calculates total fees using the oversized MAX_TOTAL_FEES.
External pre-conditions
None. This issue arises solely from internal misconfiguration.
A user interacts with the contract, incurring a total fee of 100% instead of 10%.
Impact
Users are charged excessive fees due to the miscalculated fee limit, resulting in financial loss. The discrepancy could also undermine trust in the protocol and harm its reputation.
PoC
Here’s a test case that demonstrates the issue (use it as part of ethos/packages/contracts/test/vouch/vouch.fees.test.ts file):
it('Maximum total fees exceed 10%',async()=>{constentryFee=5000n;constdonationFee=2500n;constvouchIncentives=2500n;awaitdeployer.ethosVouch.contract.connect(deployer.ADMIN).setEntryProtocolFeeBasisPoints(entryFee);awaitdeployer.ethosVouch.contract.connect(deployer.ADMIN).setEntryDonationFeeBasisPoints(donationFee);awaitdeployer.ethosVouch.contract.connect(deployer.ADMIN).setEntryVouchersPoolFeeBasisPoints(vouchIncentives);constamount=100000000000000000n;// 0.1 ETHconst{ vouchId }=awaituserA.vouch(userB,{paymentAmount: amount});constbalance=awaituserA.getVouchBalance(vouchId);constfeeTaken=amount-balance;constfeeAt10Percent=(amount*1000n)/10000n;expect(feeTaken).to.be.gt(feeAt10Percent);});
Mitigation
Change the value of MAX_TOTAL_FEES to 1000 to reflect 10% of the BASIS_POINT_SCALE.
Fit Lavender Cobra
Medium
Admins can set total fees to exceed 10% of
BASIS_POINT_SCALE
Summary
An incorrect value for
MAX_TOTAL_FEES
, allows cumulative fees to exceed the intended 10% of theBASIS_POINT_SCALE
. This issue arises becauseMAX_TOTAL_FEES
is set to10000
, representing 100% instead of 10%. Admins can unintentionally (or maliciously) configure fee percentages that result in excessive fees being charged to users.From doc:
Root Cause
In
EthosVouch.sol
, theMAX_TOTAL_FEES
constant is set to10000
(see here) instead of1000
, which represents 10% of theBASIS_POINT_SCALE
. This discrepancy allows cumulative fees (entry protocol fee, exit fee, donation fee, and vouchers pool fee) to reach 100% rather than the intended 10%.Internal pre-conditions
5000
basis points (50%).2500
basis points (25%).2500
basis points (25%).MAX_TOTAL_FEES
.External pre-conditions
None. This issue arises solely from internal misconfiguration.
Attack Path
setEntryProtocolFeeBasisPoints(5000)
.setEntryDonationFeeBasisPoints(2500)
.setEntryVouchersPoolFeeBasisPoints(2500)
.Impact
Users are charged excessive fees due to the miscalculated fee limit, resulting in financial loss. The discrepancy could also undermine trust in the protocol and harm its reputation.
PoC
Here’s a test case that demonstrates the issue (use it as part of
ethos/packages/contracts/test/vouch/vouch.fees.test.ts
file):Mitigation
Change the value of MAX_TOTAL_FEES to 1000 to reflect 10% of the BASIS_POINT_SCALE.
The text was updated successfully, but these errors were encountered: