Normal behavior:
The collectFee function allows the designated collector address to withdraw accumulated fees in both WETH tokens and ETH from the contract.
Issue:
The function sends ETH to the s_collector address using a low-level call. If the s_collector address is a contract that rejects or reverts on receiving ETH (for example, due to a fallback or receive function that reverts), the call will fail. This causes the entire collectFee function to revert and prevents the collector from withdrawing fees indefinitely, resulting in a Denial of Service (DoS).
Likelihood:
Occurs whenever the collector address is a contract that reverts upon receiving ETH.
May also occur if the collector address is mistakenly set to a contract without proper ETH receiving logic.
Attack is easily reproducible and can occur on any system where the collector contract rejects ETH.
Automation costs are minimal (<0.003 ETH at 30 gwei gas price).
Impact:
Permanent Denial-of-Service: Fee collection is blocked indefinitely because the contract cannot send ETH to a contract that reverts, leaving accumulated ETH fees locked in the contract.
Locked funds: Accumulated ETH fees remain inaccessible, effectively making the contract non-functional and reducing its utility.
Loss of funds: If the ETH fees accumulate without retrieval, the contract may face a permanent loss of accumulated fees.
Reduced trust: The vulnerability reduces user confidence in the contract, and stakeholders may become frustrated with the inability to withdraw fees.
Explanation:
Legitimate user calls collectFee() to withdraw fees.
Attacker sets the s_collector to a contract (RejectEth) that rejects ETH transfers, causing the low-level call to fail.
The original user is unable to collect fees because the call fails, locking up ETH indefinitely.
Explanation
Solution: The fix uses a safer transfer method such as .send() or .call() with limited gas, which will return false on failure instead of reverting the entire transaction.
Security: By ensuring that the function does not revert on failure, the contract can handle failed transfers gracefully and avoid blocking the entire fee collection process.
Efficiency: The fix reduces the risk of locking up funds by allowing the system to handle failure scenarios without complete disruption.
Compatibility: The fix is backward-compatible and will not break existing interfaces while mitigating the vulnerability.
This vulnerability is considered critical 10/10 severity because it leads to Denial-of-Service for fee collection, locking up funds and reducing the utility of the contract. The fix restores the contract’s functionality, ensuring that funds can be withdrawn despite potential issues with the recipient contract. The fix also prevents the system from becoming non-functional due to a single point of failure.
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.