Manipulations of setFee
The setFee function allows an admin to set fees up to 100% and can be changed at any time, including after deposits are made, potentially harming users. An attacker with admin privileges could frontrun deposits or retroactively increase fees, though the report notes this requires trust in the admin.
Submitted by pauliax
BribeVault.sol#L104-L113 BribeVault.sol#L164 BribeVault.sol#L213 BribeVault.sol#L256
If we consider that the fee variable is meaningfully applied, there will still be several problems with this:
- Admin can setFee up to 100%. This is bad for users, fees should have a reasonable upper limit, e.g. 30% to prevent potential griefing.
- Tokens are transferred in a separate function called transferBribes, which means that depositBribe txs have already settled. setFee can happen anytime, so an admin can change fees for already made deposits. I think this is again bad for users, as you need extra trust on an admin to not exploit this, and smart contracts should aim for as little external trust as possible.
- Even if a fee would be applied in depositBribe, function setFee could frontrun user deposits. Consider using a timelock, so that users have time to react and adjust.
kphed (Redacted Cartel) disagreed with Medium severity and commented:
We will likely set an upper bound as recommended, to ease user concerns. The admin being the Redacted multisig should also instill much trust and address most concerns.
Alex the Entreprenerd (judge) commented:
The warden identified a potential admin privilege that would allow to set the fee to 100%.
I agree with the finding and severity.
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 setFee function lacks an upper bound and a timelock, allowing the admin to change fees arbitrarily and retroactively.
Impact
An admin could set fees up to 100% and change them after deposits, potentially causing financial loss to users, though the report notes this requires trust in the admin.
What the attacker needed
Admin privileges
The fix
The fee should have a reasonable upper limit (e.g., 30%) and a timelock should be used so users can react to fee changes.
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 smart contract has a fee that an admin can change. The report says the admin could set the fee very high (even 100%) and could change it after users have already deposited, which is unfair to users. It suggests adding a maximum fee and a delay before changes take effect.
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.