Submitted by WatchPug
In the current implementation, when there is a fee on follow or collect, users need to approve to the follow modules or collect module contract, and then the Hub contract can call processFollow() and transfer funds from an arbitrary address (as the follower parameter).
FeeFollowModule.sol#L75-L91
A common practice is asking users to approve an unlimited amount to the contracts. Normally, the allowance can only be used by the user who initiated the transaction.
Its not a problem as long as transferFrom will always only transfer funds from msg.sender and the contract is non-upgradable.
However, the LensHub contract is upgradeable, and FeeFollowModule will transferFrom an address decided by an input parameter follower, use of upgradeable proxy contract structure allows the logic of the contract to be arbitrarily changed.
This allows the proxy admin to perform many malicious actions, including taking funds from users wallets up to the allowance limit.
This action can be performed by the malicious/compromised proxy admin without any restriction.
Given:
Improper management of users allowance is the root cause of some of the biggest attacks in the history of DeFi security. We believe there are 2 rules that should be followed:
We suggest adding a non-upgradeable contract for processing user payments:
This comes with an additional benefit: users only need to approve one contract instead of approving multiple follow or collect module contracts.
Zer0dot (Aave Lens) acknowledged, but disagreed with High severity and commented:
0xleastwood (judge) decreased severity to Medium and commented:
Zer0dot (Aave Lens) commented:
0xleastwood (judge) commented:
