Open code423n4 opened 1 year ago
This report is a subset of this #108 Same resolution, we accept it but we disagree with the severity, it should be Low.
donosonaumczuk marked the issue as disagree with severity
Downgrading to Low as in #108
Picodes changed the severity to QA (Quality Assurance)
This previously downgraded issue has been upgraded by Picodes
This previously downgraded issue has been upgraded by Picodes
Picodes marked the issue as duplicate of #108
Picodes marked the issue as satisfactory
Picodes marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2023-07-lens/blob/main/contracts/FollowNFT.sol#L131-L138 https://github.com/code-423n4/2023-07-lens/blob/main/contracts/FollowNFT.sol#L255-L258
Vulnerability details
Bug Description
When the
LensHub
contract has been paused by governance (_state
set toProtocolState.Paused
), users should not be able unfollow profiles. This can be inferred as theunfollow()
function has thewhenNotPaused
modifier:LensHub.sol#L368-L371
However, in the
FollowNFT
contract, which is deployed for each profile that has followers, theremoveFollower()
andburn()
functions do not check if theLensHub
contract is paused:FollowNFT.sol#L131-L138
FollowNFT.sol#L255-L258
As such, whenever the system has been paused by governance, users will still be able to unfollow profiles by wrapping their followNFT and then calling either
removeFollower()
orburn()
.Impact
Users are able to unfollow profiles when the system is paused, which they should not be able to do.
This could be problematic if governance ever needs to temporarily pause unfollow functionality (eg. for a future upgrade, or unfollowing functionality has a bug, etc...).
Proof of Concept
The Foundry test below demonstrates how users will still be able to unfollow profiles by calling
wrap()
andremoveFollower()
, even after the system has been paused by governance. It can be run with the following command:Recommended Mitigation
All
FollowNFT
contracts should check that theLensHub
contract isn't paused before allowingremoveFollower()
orburn()
to be called. This can be achieved by doing the following:whenNotPaused
modifier toFollowNFT.sol
:removeFollower()
andburn()
:FollowNFT.sol#L131-L138
FollowNFT.sol#L255-L258
Assessed type
Access Control