veRWA - Naubit'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: 110/125

Findings: 1

Award: $4.23

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-08-verwa/blob/498a3004d577c8c5d0c71bff99ea3a7907b5ec23/src/GaugeController.sol#L210 https://github.com/code-423n4/2023-08-verwa/blob/498a3004d577c8c5d0c71bff99ea3a7907b5ec23/src/GaugeController.sol#L212

Vulnerability details

Impact

An invalid value is not being ignored but accepted even if the natspec states it should be ignored.

Proof of Concept

In the GaugeController.sol contract there is a function called vote_for_gauge_weights. The natspec of that function states that the _user_weight var value is ignored if 0 (so the function should revert) (https://github.com/code-423n4/2023-08-verwa/blob/498a3004d577c8c5d0c71bff99ea3a7907b5ec23/src/GaugeController.sol#L210C16-L210C28).

But in the require used to check exactly that condition, it is allowing the 0 value:

require(_user_weight >= 0 && _user_weight <= 10_000, "Invalid user weight");

That makes invalid the instructions from the natspec and could potentially create unexpected issues and other issues since everyone will be expecting to not have a 0 value in the _user_weightvar.

Tools Used

Manual review.

Replace the code with:

+ require(_user_weight > 0 && _user_weight <= 10_000, "Invalid user weight");
- require(_user_weight >= 0 && _user_weight <= 10_000, "Invalid user weight");

Assessed type

Invalid Validation

#0 - c4-pre-sort

2023-08-13T07:15:37Z

141345 marked the issue as duplicate of #94

#1 - c4-judge

2023-08-24T06:21:26Z

alcueca changed the severity to QA (Quality Assurance)

#2 - c4-judge

2023-08-24T06:24:02Z

alcueca marked the issue as grade-b

#3 - alcueca

2023-08-24T06:25:02Z

Without proof that the function should actually revert, it is clear that this is a natspec error. No proof either that natspec can induce to incidents of Medium or High severity.

#4 - c4-judge

2023-08-24T06:27:34Z

This previously downgraded issue has been upgraded by alcueca

#5 - c4-judge

2023-08-24T06:28:02Z

alcueca changed the severity to QA (Quality Assurance)

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