The withdrawFees function allows the owner to withdraw totalFees worth of ETH. However, the contract also holds user deposits from likeUser calls (ETH sent via msg.value). The receive() function allows arbitrary ETH deposits. There is no accounting separation between protocol fees and user deposits.
If userBalances tracking is fixed (H-01), and fees are properly computed, the withdrawFees function uses totalFees to determine the withdrawal amount, which should in theory only withdraw the fee portion. However, the contract balance includes all user deposits, fees, and any accidental ETH sends. A scenario where totalFees is manipulated or miscalculated could drain user funds.
Additionally, the receive() function means anyone can send ETH to the contract, inflating the balance without any accounting.
Likelihood:
Low. The owner would need to intentionally or accidentally manipulate totalFees, or the accounting would need to diverge from expected behavior.
Impact:
Unaccounted ETH sent to the contract via receive() is trapped permanently (no withdrawal path for it).
Minor accounting concerns.
This test shows that ETH sent directly to the LikeRegistry via receive() is permanently trapped — withdrawFees only withdraws the totalFees amount, which does not account for directly-sent ETH, leaving it locked with no recovery path.
Remove the open receive() function to prevent untracked ETH from entering the contract. The contract already receives ETH through likeUser (which is payable), so a bare receive() is unnecessary. If direct ETH deposits are intentionally supported, add an accounting variable to track them and provide the owner a withdrawal path for unaccounted funds.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.