Submitted by MiloTruck, also found by maanas and Prestige
If the followTokenId of a profile is wrapped, users will only be able to unfollow if they are either:
This can be seen in the unfollow() function of FollowNFT.sol:
FollowNFT.sol#L115-L125
As seen from above, users that are not the owner or do not have approval for the wrapped follow NFT will not be able to unfollow. This is problematic as users are able to follow with a followTokenId without owning the corresponding follow NFT.
For example, someone who holds a follow NFT can call approveFollow() for a user. The user can then call follow() with the corresponding followTokenId, which works as _followWithWrappedToken() checks for follow approval:
FollowNFT.sol#L317-L327
Now, if the user wants to unfollow, he will be unable to do so by himself, and is forced to rely on the follow NFT owner to unfollow for his profile.
Users that follow using a wrapped followTokenId that they do not own will not be unfollow the profile. This is incorrect as a profile owner should have full control over who the profile does/does not follow.
The Foundry test below demonstrates that unfollow() will revert when users do not own the FollowNFT, even when unfollowing with their own profile. It can be run with the following command:
In unfollow(), consider allowing the owner of unfollowerProfileId to unfollow as well:
FollowNFT.sol#L115-L125
Access Control
donosonaumczuk (Lens) disagreed with severity and commented:
Picodes (judge) commented:
