LikeRegistry::receive
allows the contract to receive ETH but they can't be used or withdrawn in any way.
Based on the code, LikeRegistry::receive
allows the contract to receive ETH.
However, should an app user, (or any contract address in fact), decide to fund the contract, the ETH would be locked forever as there's no functionality that makes use of them.
The following PoC demonstrates the said bug. Place test_AnyoneCanFundLikeRegistryContract
in testSoulboundProfileNFT.t.sol
:
Loss of funds
Manual review, tests
According to the docs, effective payments should be made through LikeRegistry::likeUser
. Since any other source of funds (i.e via receive
) isn't used in any way, it's best to remove the functionality overall to prevent the funds from getting locked. Should the app dev decide to integrate receive
's funds in the future, she should consider keeping track of ETH payments in receive
, implement proper access control so that non-registered users can't fund the contract, as well as the ability to withdraw funds.
Not the best design, but if you send money accidentally, that's a user mistake. Informational.
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.