Description:
The LikeRegistry
contract lacks a mechanism for users to recover ETH sent with likes that never result in matches. Once a user sends ETH with a like, there is no way to withdraw it if the liked user never reciprocates. This creates a permanent lock of user funds, as the ETH remains stuck in the contract indefinitely.
The contract has no functions that allow:
Withdrawal of ETH from unmatched likes after a time period
Cancellation of existing likes
Recovery of funds from likes that will never be matched
Impact:
HIGH - This vulnerability leads to permanent loss of user funds in several scenarios:
When liked users never reciprocate
If liked users become inactive
If liked users lose their private keys
If users like the wrong address by mistake
If the liked address is a person that cannot/will not like back
The impact is especially severe because:
Each like requires at least 1 ETH
Multiple likes can be sent, multiplying locked funds
There is no time limit on the lock
The funds remain locked even if it becomes certain no match will occur
Proof of Code:
Proof of Concept:
Step-by-step demonstration of funds being permanently locked:
Alice sends a like to Bob with 2 ETH:
Bob never likes Alice back (account lost, inactive, etc.)
Alice has no way to recover her 2 ETH:
The ETH remains stuck in the contract forever:
Recommended Mitigation:
Add a time-based recovery mechanism for unmatched likes:
Additional recommendations:
Add a like cancellation window (e.g., 1 hour) for immediate recovery of mistaken likes
Implement a maximum like duration after which likes expire and ETH can be recovered
Add events for withdrawals and cancellations
Consider adding a fee for early withdrawals to prevent gaming
Add clear documentation about the recovery process
These changes will prevent permanent fund lockup while maintaining the core matching mechanism's integrity.
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.