Debt DAO contest - Nyx's results

A cryptonative credit marketplace for fully anon and trustless loans to DAOs.

General Information

Platform: Code4rena

Start Date: 03/11/2022

Pot Size: $115,500 USDC

Total HM: 17

Participants: 120

Period: 7 days

Judge: LSDan

Total Solo HM: 1

Id: 174

League: ETH

Debt DAO

Findings Distribution

Researcher Performance

Rank: 68/120

Findings: 3

Award: $72.10

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

8.0811 USDC - $8.08

Labels

bug
2 (Med Risk)
satisfactory
duplicate-39

External Links

Lines of code

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/modules/credit/LineOfCredit.sol#L223-L244 https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L59-L74

Vulnerability details

Impact

When a user wants to use addCredit() function with ETH, user can mistakenly send more ETH than amount. If that happens, User ETH can be frozen inside the contract.

Proof of Concept

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L70-L72

Test :

function test_canSendMoreETHThanAmount() public { assertEq(address(line).balance, 0, "Line balance should be 0"); assertEq( lender.balance, mintAmount, "lender should have initial mint balance" ); console.log(lender.balance / 1e18); hoax(borrower); line.addCredit(dRate, fRate, 1 ether, Denominations.ETH, lender); vm.startPrank(lender); line.addCredit{value: 2 ether}( dRate, fRate, 1 ether, Denominations.ETH, lender ); vm.stopPrank(); console.log("Lender balance after addCredit", lender.balance / 1e18); console.log( "line balance after addCredit", address(line).balance / 1e18 ); }

Tools Used

Manuel review

msg.value needs to be equal to amount.

#0 - c4-judge

2022-11-15T16:20:24Z

dmvt marked the issue as duplicate of #25

#1 - c4-judge

2022-12-06T16:32:13Z

dmvt marked the issue as satisfactory

#2 - C4-Staff

2022-12-20T06:44:54Z

liveactionllama marked the issue as duplicate of #39

Awards

2.6694 USDC - $2.67

Labels

bug
2 (Med Risk)
partial-50
duplicate-369

External Links

Lines of code

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L48

Vulnerability details

Impact

transfer() uses a fixed amount of gas, which can result in revert.

transfer() uses a fixed amount of gas, which was used to prevent reentrancy. However this limit your protocol to interact with others contracts that need more than that to process the transaction.

Proof of Concept

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L48

Tools Used

Manuel review

Consider using .call() instead with the checks-effects-interactions pattern implemented correctly. Careful consideration needs to be made to prevent reentrancy.

#0 - c4-judge

2022-11-15T20:52:43Z

dmvt marked the issue as duplicate of #14

#1 - c4-judge

2022-11-17T19:13:23Z

dmvt marked the issue as partial-50

#2 - C4-Staff

2022-12-20T05:56:43Z

liveactionllama marked the issue as duplicate of #369

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