As the sponsor confirmed, they will support USDT/USDC with a blacklist mechanism as a whitelist token. When the fee recipient is blacklisted, transferring to the blacklisted address will cause the entire tx to revert. There are two modules in the codebase that will be affected: SimpleFeeCollectModule, MultirecipientFeeCollectModule. The case discussed here is: when the fee recipient is blacklisted is not during initialization but after initialization.
If the recipient is blacklisted, then L249 will revert. Because SimpleFeeCollectModule does not override _transferToRecipients, it uses the above code. MultirecipientFeeCollectModule overrides the function, the code is as follows:
Lines of code
https://github.com/code-423n4/2023-07-lens/blob/main/contracts/modules/act/collect/base/BaseFeeCollectModule.sol#L249 https://github.com/code-423n4/2023-07-lens/blob/main/contracts/modules/act/collect/MultirecipientFeeCollectModule.sol#L176-L195
Vulnerability details
Impact
As the sponsor confirmed, they will support USDT/USDC with a blacklist mechanism as a whitelist token. When the fee recipient is blacklisted, transferring to the blacklisted address will cause the entire tx to revert. There are two modules in the codebase that will be affected: SimpleFeeCollectModule, MultirecipientFeeCollectModule. The case discussed here is: when the fee recipient is blacklisted is not during initialization but after initialization.
Proof of Concept
Both SimpleFeeCollectModule and MultirecipientFeeCollectModule inherit from BaseFeeCollectModule. SimpleFeeCollectModule can initialize a single fee recipient, while MultirecipientFeeCollectModule can initialize multiple fee recipients. However, none of these two modules can update the fee recipient after initialization.
When a user collects one publication via LensHub.act, the flow is as follows:
The code of
BaseFeeCollectModule.processCollect
is as follows:_processCollect/_processCollectWithReferral will subcall
_transferToRecipients
internally.If the recipient is blacklisted, then L249 will revert. Because SimpleFeeCollectModule does not override
_transferToRecipients
, it uses the above code. MultirecipientFeeCollectModule overrides the function, the code is as follows:Any recipient is blacklisted in the
recipients
array, tx will revert.As mentioned above, if the fee recipient specified by a publication is blacklisted, no one can collect the publication anymore.
Tools Used
Manual Review
Recommended Mitigation Steps
It is recommended to add a function for the owner of the publication to update the fee recipient.
Assessed type
DoS