Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skinny Shadow Sparrow - Unauthorized Delegation of Voting Power Leading to Loss of Token Control #76

Open
sherlock-admin4 opened this issue Dec 22, 2024 · 0 comments
Labels
Won't Fix The sponsor confirmed this issue will not be fixed

Comments

@sherlock-admin4
Copy link
Contributor

Skinny Shadow Sparrow

High

Unauthorized Delegation of Voting Power Leading to Loss of Token Control

Summary

Alice deposits her governance tokens into a pool contract.
The pool contract deploys a surrogate contract for Alice, which holds Alice's tokens and delegates the voting power to Bob.
Now Bob can use Alice's voting power in governance, as the surrogate has delegated 100% of Alice's tokens to Bob.
However, if Bob creates another surrogate contract and delegates Alice's voting power to someone else (e.g., Alex), Alice's tokens are still tied to Bob's surrogate contract. This means that if Alice decides to reclaim her tokens, Bob (or Alex) would still have the voting power, and Alice can't reclaim her tokens unless Bob revokes his delegation.
Issue: Bob Can Delegate to Someone Else Without Alice's Knowledge
The problem here is that Bob can effectively transfer voting power by creating a new surrogate contract and delegating Alice's tokens to someone else (e.g., Alex), but there is no tracking mechanism that ties Bob's delegatee (or the chain of delegations) back to Alice's tokens. This means:

Alice has no direct way to reclaim her voting power unless Bob explicitly revokes the delegation.
If Alice tries to reclaim her tokens, Bob still holds the voting power via the surrogate, but the tokens are locked up until Bob either revokes the delegation or returns the power to Alice.
Solution to the Problem:
You need to track delegations and ensure that Alice can reclaim her tokens regardless of whether Bob delegates them further. This can be done by recording delegatee chains and preventing Bob from arbitrarily transferring Alice's voting power to someone else.

Impact

Depositor not being able to withdraw his funds

Code Snippet

Tool used

Manual Review

Recommendation

You should maintain a delegation chain for each token holder (i.e., Alice) in the surrogate contract. This chain can track where Alice's voting power is being delegated, ensuring it’s clear who has the power at any given time.
Reclaim Tokens with Delegation Reversal:

When Alice attempts to reclaim her tokens, the system should check the current delegatee (Bob or anyone else) and ensure that the tokens are either returned directly to Alice or Bob (whoever has the final delegation).
Prevent Bob from Transferring Voting Power Freely:

Bob should not be allowed to freely delegate voting power without updating the surrogate contract's records. Instead, Bob’s ability to delegate the power should be constrained by the contract, so Alice can always reclaim her tokens from the surrogate once they are no longer delegated.

@sherlock-admin3 sherlock-admin3 added the Won't Fix The sponsor confirmed this issue will not be fixed label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Won't Fix The sponsor confirmed this issue will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants