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

Unable to undelegate if the delegatee's unlockTime exceeds that of the owner. #362

Closed
code423n4 opened this issue Aug 10, 2023 · 12 comments
Closed
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-182 partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) upgraded by judge Original issue severity upgraded from QA/Gas by judge

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-08-verwa/blob/498a3004d577c8c5d0c71bff99ea3a7907b5ec23/src/VotingEscrow.sol#L384

Vulnerability details

Description and Impact

In the delegate() function, if the delegatee's unlockTime surpasses that of the owner, the owner cannot perform an undelegation. As a result, the owner becomes unable to withdraw funds since the withdraw() function necessitates the owner's delegatee to be the owner themselves.

Proof of Concept

  1. Both Alice and Bob utilize the createLock() function to lock their tokens.
  2. Alice invokes the delegate(Bob) function, thereby delegating her tokens to Bob.
  3. Bob accesses the increaseAmount() function, extending the lock duration of his tokens.
  4. Alice attempts to use the delegate(msg.sender) function but encounters an inability to undelegate due to Bob's lock duration surpassing that of Alice's.

Recommended Mitigation Steps

We recommend implementing a mechanism where the owner inherits the unlockTime of the delegatee if it happens to exceed the owner's own unlockTime.

Assessed type

Governance

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Aug 10, 2023
code423n4 added a commit that referenced this issue Aug 10, 2023
@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #116

@c4-pre-sort
Copy link

141345 marked the issue as not a duplicate

@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #116

@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #82

@c4-judge c4-judge added 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Aug 24, 2023
@c4-judge
Copy link

alcueca changed the severity to 3 (High Risk)

@c4-judge c4-judge added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value downgraded by judge Judge downgraded the risk level of this issue and removed 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge labels Aug 24, 2023
@c4-judge
Copy link

alcueca changed the severity to 2 (Med Risk)

@c4-judge
Copy link

alcueca marked the issue as partial-50

@c4-judge c4-judge added the partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) label Aug 24, 2023
@c4-pre-sort c4-pre-sort reopened this Aug 24, 2023
@c4-pre-sort c4-pre-sort removed the partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) label Aug 24, 2023
@c4-pre-sort
Copy link

141345 marked the issue as not a duplicate

@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #375

@c4-judge
Copy link

alcueca marked the issue as partial-50

@c4-judge c4-judge added partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) duplicate-245 and removed duplicate-375 labels Aug 24, 2023
@c4-judge
Copy link

alcueca marked the issue as duplicate of #182

@c4-judge c4-judge added duplicate-182 and removed duplicate-245 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value downgraded by judge Judge downgraded the risk level of this issue labels Aug 29, 2023
@c4-judge
Copy link

alcueca changed the severity to 3 (High Risk)

@c4-judge c4-judge added 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge labels Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-182 partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) upgraded by judge Original issue severity upgraded from QA/Gas by judge
Projects
None yet
Development

No branches or pull requests

3 participants