veRWA - seerether's results

Incentivization Primitive for Real World Assets on Canto

General Information

Platform: Code4rena

Start Date: 07/08/2023

Pot Size: $36,500 USDC

Total HM: 11

Participants: 125

Period: 3 days

Judge: alcueca

Total Solo HM: 4

Id: 274

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 54/125

Findings: 1

Award: $21.60

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

21.6049 USDC - $21.60

Labels

bug
3 (High Risk)
low quality report
partial-50
upgraded by judge
duplicate-268

External Links

Lines of code

https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L366 https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L398 https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L331

Vulnerability details

Impact

  • User A will not be able to withdraw their tokens even after their lock expires if the delegatee (User B) has -withdrawn their lock.

  • User A is essentially "orphaned" - their delegatee withdrew so they have no voting power, but their lock still shows a delegation.

Proof of Concept

User A will not be able to withdraw their tokens even after their lock expires if the delegatee (User B) has withdrawn their lock.

The key parts of the code that lead to this are:

In delegate() - This updates the delegatee address on User A's lock struct to User B : https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L366

And in _delegate() - This subtracts the delegated amount from User B's lock struct when User B withdraws: https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L398

However, there is no code that resets User A's delegatee address back to their own address when User B withdraws. So the sequence would be:

  1. User A delegates to User B
  2. User B withdraws their lock
  3. User A's lock expires but delegatee is still set to User B
  4. User A tries to withdraw but it reverts due to require(locked_.delegatee == msg.sender, "Lock delegated"); in https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L331

Tools Used

Manual

reset the delegator's delegatee address to their own address when the delegatee withdraws their lock

Assessed type

Other

#0 - c4-pre-sort

2023-08-11T11:55:44Z

141345 marked the issue as duplicate of #223

#1 - c4-pre-sort

2023-08-13T11:50:44Z

141345 marked the issue as not a duplicate

#2 - c4-pre-sort

2023-08-13T16:40:24Z

141345 marked the issue as duplicate of #112

#3 - 141345

2023-08-13T16:40:57Z

it's not about delegatee withdraw or not

#4 - c4-pre-sort

2023-08-14T07:18:56Z

141345 marked the issue as not a duplicate

#5 - c4-pre-sort

2023-08-14T07:19:10Z

141345 marked the issue as low quality report

#6 - c4-pre-sort

2023-08-14T07:30:29Z

141345 marked the issue as duplicate of #471

#7 - c4-judge

2023-08-25T11:26:25Z

alcueca marked the issue as not a duplicate

#8 - c4-judge

2023-08-25T11:26:34Z

alcueca changed the severity to 2 (Med Risk)

#9 - c4-judge

2023-08-25T11:27:10Z

alcueca marked the issue as duplicate of #268

#10 - c4-judge

2023-08-25T11:27:14Z

alcueca marked the issue as partial-50

#11 - c4-judge

2023-08-26T21:24:29Z

alcueca changed the severity to 3 (High Risk)

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter