Description:
The LikeRegistry contract may lock ETH permanently if funds are sent to it outside of LikeRegistry::likeUser()
, as the contract only tracks ETH collected through this function.
The issue arises because LikeRegistry::withdrawFees()
attempts to transfer only the amount tracked in totalFees
, rather than the actual ETH balance of the contract. Any ETH received outside of the expected flow will not be withdrawable, causing it to be locked.
Impact:
Low – No user funds are lost, and protocol functionality remains unaffected. However, if ETH is mistakenly sent to the contract in an unexpected way, it will become permanently locked since withdrawFees() does not allow the owner to withdraw funds beyond the tracked totalFees.
Proof of Concept:
In the test below, a user sends 1 ETH directly to the contract. Since totalFees is not updated, the owner is unable to withdraw this ETH.
Recommended Mitigation:
Modify withdrawFees() to withdraw the contract’s actual balance rather than the tracked totalFees:
This ensures that any ETH held by the contract, regardless of how it was received, can be withdrawn, preventing funds from becoming permanently locked.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.