Submitted by kenzo, also found by GiveMeTestEther and cmichel
If calling transferFrom with _from == _recipient, the key will get destroyed (meaning the key will be set as expired and set the owners key to be 0).
A key manager or approved might accidentally destroy users token.
Note: this requires user error and so Im not sure if this is a valid finding.
However, few things make me think that it is valid:
By following transferFroms execution:
https://github.com/code-423n4/2021-11-unlock/blob/main/smart-contracts/contracts/mixins/MixinTransfer.sol#L109:#L166
One can see that in the case where _from == _recipient with a valid key:
Therefore, the user will lose his key without getting a refund.
Add a require statement in the beginning of transferFrom:
require(_from != _recipient, 'TRANSFER_TO_SELF');
julien51 (Unlock Protocol) confirmed
julien51 (Unlock Protocol) commented:
