owner uses the ChangeFee() function to set transparent, asymmetric buy/sell fees to manage token economics. The swappers pay these fees when trading, expecting a functional and non-confiscatory rate.Specific Issue: The owner possesses unrestricted administrative control over the core economic mechanism. The ability to modify the sell fee rate via ChangeFee() without any hard limit (fee cap) or time lock allows a malicious or compromised owner to instantly set a 100% sell fee. Since swappers are explicitly limited from bypassing hook-enforced fees, this action effectively traps all ReFi tokens held by users in the pool, resulting in total loss of principal upon selling.
Likelihood
High
Reason 1
This vulnerability is present immediately upon deployment and remains present throughout the hook's existence.
Reason 2
A malicious or compromised owner's private key can execute the attack with a single transaction at any time, requiring no preconditions other than the existence of the deployed hook.
Impact
Critical
Impact 1
Total loss of swappers' deposited funds (ReFi tokens), as the 100% sell fee traps the tokens in the contract. Swappers cannot sell them without losing the entire principal.
Impact 2
Complete loss of trust and abandonment of the RebateFi protocol, as the core economic incentive (fee structure) can be instantly corrupted by a single entity.
Proof of Concept
Explanation: By executing setSellFee(10000), the owner can ensure that when a swapper attempts to sell tokens, the fee calculation (amountToSell - fee) results in zero tokens returned to the user. This is a direct loss of user principal, confirming the confiscatory nature of the vulnerability.
Mitigation Explanation:
Fee Cap (MAX_SELL_FEE_RATE): The proposeFeeChange function now includes a require check ensuring the proposed sell fee cannot exceed a reasonable, predefined value (e.g., 10%). This eliminates the possibility of a 100% confiscatory fee, severely limiting the maximum potential loss for users.
Time Lock Mechanism: The single, immediate ChangeFee() function is replaced by a two-step process (proposeFeeChange and activateFeeChange).
The fee change is proposed and registered with an activation time (e.g., 48 hours in the future).
The change can only be activated once the timelock has expired. This delay provides users with sufficient time to exit the pool if the proposed new fee is deemed unfavorable, preventing the owner from rug-pulling users instantly.
Governance Transfer: It is highly recommended to transfer the onlyOwner role to a Multi-Signature (Multi-Sig) wallet or a DAO governance contract. This decentralizes control and requires consensus from multiple, independent parties to execute fee changes, further reducing the risk of a single malicious actor.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.