code-423n4 / 2024-02-uniswap-foundation-findings

2 stars 3 forks source link

Delegation should not be allowed to `address(0)` #395

Closed c4-bot-9 closed 7 months ago

c4-bot-9 commented 7 months ago

Lines of code

https://github.com/code-423n4/2024-02-uniswap-foundation/blob/491c7f63e5799d95a181be4a978b2f074dc219a5/src/DelegationSurrogate.sol#L27 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/491c7f63e5799d95a181be4a978b2f074dc219a5/src/DelegationSurrogate.sol#L27

Vulnerability details

Impact

"Delegating votes leaves the token owner with votes while giving the delegate additional votes"): if a user delegates to address(0) that vote gets lost.

Proof of Concept

https://github.com/code-423n4/2024-02-uniswap-foundation/blob/491c7f63e5799d95a181be4a978b2f074dc219a5/src/DelegationSurrogate.sol#L26C6-L26C12

Tools Used

manual

Recommended Mitigation Steps

Don't allow delegation to address(0) by adding a check

Assessed type

call/delegatecall

MarioPoneder commented 7 months ago

User error

c4-judge commented 7 months ago

MarioPoneder marked the issue as unsatisfactory: Overinflated severity