Debt DAO contest - R2'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: 35/120

Findings: 1

Award: $220.35

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: berndartmueller

Also found by: 0xdeadbeef0x, Jeiwan, R2, ayeslick, minhquanym

Labels

bug
2 (Med Risk)
downgraded by judge
partial-50
duplicate-467

Awards

220.3469 USDC - $220.35

External Links

Lines of code

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/modules/credit/LineOfCredit.sol#L483 https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L34 https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/utils/LineLib.sol#L48

Vulnerability details

Impact

In LineOfCredit._close() you are calling LineLib.sendOutTokenOrETH(). And there if token is ETH, you are using this statement to sent ETH to lender: payable(receiver).transfer(amount); But if lender is a smart contract with deleted fallback() and receive() functions, the transfer will fail

If LineOfCredit._close() was called from LineOfCredit.depositAndClose(), it will lead to DoS Because you are sending tokens/ETH to lenders one by one, but the first one may be malicious lender

Proof of Concept

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/modules/credit/LineOfCredit.sol#L308

https://github.com/debtdao/Line-of-Credit/blob/e8aa08b44f6132a5ed901f8daa231700c5afeb3a/contracts/modules/credit/LineOfCredit.sol#L483

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

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

Tools Used

vs code

If ETH transfer fails, send to user WETH tokens

#0 - c4-judge

2022-11-17T15:48:01Z

dmvt marked the issue as duplicate of #85

#1 - c4-judge

2022-11-17T20:37:46Z

dmvt marked the issue as partial-50

#2 - c4-judge

2022-11-17T20:40:42Z

dmvt changed the severity to 2 (Med Risk)

#3 - C4-Staff

2022-12-20T05:44:39Z

liveactionllama marked the issue as duplicate of #467

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