Open hats-bug-reporter[bot] opened 7 months ago
Not an issue, it's limited by userLockEnd
Not an issue, it's limited by
userLockEnd
?
Invalid, see in #46
Invalid, see in #46
Proxy manager can set himself as a proxy is the main issue here.
Invalid, see in #46
Proxy manager can set himself as a proxy is the main issue here.
See answer : https://github.com/hats-finance/Paladin-0x1610bfde27e57b068af7f38aec3d2a7b1d146989/issues/46#issuecomment-1939132272
Github username: -- Twitter username: 97Sabit Submission hash (on-chain): 0xef1046a72d84382edfbf2e15abd9b886db3129210aee953ad1c16dc2a57ce72f Severity: high
Description: Description\ Proxy managers are able to set themselves as a user's voting proxy by calling setVoterProxy. There is no restriction on the endTimestamp they can set.
This allows a proxy manager to set themselves as a user's proxy with an endTimestamp very far in the future (e.g. 100 years from now). Even if the user later removes the proxy manager's permissions, the manager will still be set as the user's proxy and able to use their voting power until the end timestamp is reached.
For instance:
User Alice grants Bob permission as a proxy manager via approveProxyManager
Bob calls setVoterProxy setting themselves as the proxy for Alice, with a maxPower of 10% of Alice's voting power, and an endTimestamp of January 1, 2122.
Alice later decides to revoke Bob's proxy manager permissions by calling revokeProxyManager (for instance).
However, Bob is still set as Alice's proxy with 90% of her voting power until January 1, 2122.
Bob can continue voting on Alice's behalf even without her permission.
This allows proxy managers to indefinitely retain proxy access and voting rights, even after the user revokes their permissions. It undermines the ability for a user to revoke proxy manager permissions.
It is suggested that when revokeProxyManager (for instance) is called, also immediately clear any proxy set by that manager for the user.
https://github.com/PaladinFinance/Vote-Flywheel/blob/cf3c82f102a76f58acf003980c480eb9028f0e94/contracts/LootVoteController.sol#L423-L424