veRWA - Giorgio'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: 116/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/a693b4db05b9e202816346a6f9cada94f28a2698/src/LendingLedger.sol#L133-L136

Vulnerability details

Impact

If a lending market receives deposits before being whitelisted in the system, not only will the user be ineligible to earn rewards on those funds, but they will also be unable to withdraw the deposited funds.

Proof of Concept

If a lending market accepts deposits before it integrates with the LendingLedger, those initial deposits won't be tracked in the ledger. Once the lending market integrates with the LendingLedger and a user tries to withdraw, the ledger will see their balance as zero, even though they have funds in the lending market. This results in an underflow when trying to reduce their balance during a withdrawal, causing the require(updatedLenderBalance >= 0, "Lender balance underflow"); check to revert the transaction.

https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/LendingLedger.sol#L135-L136

This would effectively lock the user's funds in the lending market. The user would be unable to withdraw even though they have a balance in the lending market, because as per the LendingLedger, their balance is zero.

Tools Used

Manual review

Before integrating a Lending Market, make sure that its balance is 0.

Assessed type

Invalid Validation

#0 - 141345

2023-08-12T07:03:51Z

Lending Market or user's error

at least user should check if the lending market is ready for deposit

QA might be more appropriate.

#1 - c4-sponsor

2023-08-16T14:19:30Z

OpenCoreCH marked the issue as sponsor acknowledged

#2 - c4-sponsor

2023-08-16T14:19:34Z

OpenCoreCH marked the issue as disagree with severity

#3 - alcueca

2023-08-24T06:31:55Z

As stated elsewhere, this finding relates to contracts that have not been implemented yet. Accepted as QA for the sponsor to include on the documentation of those implementing such contracts.

#4 - c4-judge

2023-08-24T06:32:02Z

alcueca changed the severity to QA (Quality Assurance)

#5 - c4-judge

2023-08-24T06:32:06Z

alcueca marked the issue as grade-b

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