`ValueFacet::removeValueSingle(...)` will withdraw less than required from the vertex vault due to unaccounted tax
The `removeValueSingle` function in the Burve protocol calculates a tax on the removed amount but does not withdraw that tax from the underlying vertex vault, leading to a mismatch between the amount withdrawn and the amount needed for the user transfer and tax deposit. If a related double-tax issue is fixed, this mismatch could cause the function to revert due to insufficient balance, resulting in a denial of service.
Source: https://github.com/sherlock-audit/2025-04-burve-judging/issues/406
Found by
0L5S6W, 0xNov1ce, Cybrid, TessKimy, Tigerfrake, VinciGearHead, bladeee, bretzel, elolpuer, heeze, nganhg, v1c7
Summary
NB: This issue assumes that issue removeValueSingle(...) will always produce a zero realTax, leading to issues has been fixed
When users want to remove value from a single vertex in a closure with removeValueSingle, the Burve protocol charges a tax to prevent users from using add value and remove value as a swapping mechanism. When the protocol determines the required token amount and tax to be removed based on the input value, it then withdraws the set amount from the underlying vertex vault in order to deposit tax earnings and transfer user funds. However, there seems to be a mismatch between the amount being removed and the amount being withdrawn, as the calculated tax is not being withdrawn from the vault.
Root Cause
When the removedAmount is calculated in Closure::removeValueSingle(...), it has the tax deducted from it before being returned. However, when withdrawing from the vault in the facet, this tax is not taken into account, leading to fewer tokens being withdrawn from the vault.
Internal Pre-conditions
- The user adds value to a closure with a base fee.
- The user wants to remove value for a single token.
External Pre-conditions
N/A
Attack Path
N/A
Impact
In the current state, this mismatch is compensated, as the user is being double taxed here. However, if the issue Users will receive fewer tokens when using ValueFacet::removeValueSingle(...) due to double tax is fixed, then because fewer funds are taken out from the vault, there won't be enough to cover the user transfer, leading to a revert due to insufficient balance and thus to DoS of the removeValueSingle(...) function.
PoC
N/A
Mitigation
Calculate the real tax before withdrawing from the vault, and when withdrawing, add the realTax to the realRemoved being withdrawn.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Burve/commit/ca58c88be97e8f3f7a4617b171377d77fca52cdc
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
Impact
If the double-tax issue is fixed, the function could revert due to insufficient balance, causing a denial of service for `removeValueSingle`.
What the attacker needed
User adds value with a base fee; user removes value for a single token; double-tax issue is fixed
The fix
The real tax should be calculated before withdrawing from the vault, and the withdrawal amount should include the real tax.
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 remove money from a shared pool, the system charges a small fee (tax). The code correctly subtracts this fee from the amount you receive, but it forgets to take the fee out of the pool's storage. Right now another bug accidentally covers this up, but if that bug is fixed, the function could fail because there isn't enough money to send you.
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.