Trader Joe v2 contest - supernova's results

One-stop-shop decentralized trading on Avalanche.

General Information

Platform: Code4rena

Start Date: 14/10/2022

Pot Size: $100,000 USDC

Total HM: 12

Participants: 75

Period: 9 days

Judge: GalloDaSballo

Total Solo HM: 1

Id: 171

League: ETH

Trader Joe

Findings Distribution

Researcher Performance

Rank: 69/75

Findings: 1

Award: $0.01

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

0.006 USDC - $0.01

Labels

bug
2 (Med Risk)
satisfactory
duplicate-139

External Links

Lines of code

https://github.com/code-423n4/2022-10-traderjoe/blob/79f25d48b907f9d0379dd803fc2abc9c5f57db93/src/LBFactory.sol#L474

Vulnerability details

Impact

The factory owner has power to set Flash Loan fees to any arbitrary amount . This can be potentially dangerous for users , especially if they don't check the amount of flash loan fees before calling the LBPair flashLoan function (by calling the factory contract flashLoanFee variable directly to send the fees to the protocol in there callback function logic).

Example: FlashLoanFee = 500000000000000000

Contract A calls flashLoan function .

Unknowingly Sends 50% of flash loan as fees, as the contract transferred tokens by calling the factory contract directly instead of manually entering the fees to send. Clearly the User is at a loss.

Proof of Concept

https://github.com/code-423n4/2022-10-traderjoe/blob/79f25d48b907f9d0379dd803fc2abc9c5f57db93/src/LBFactory.sol#L474

Tools Used

VsCode

I recommend creating a sensible lower and upper limit in case of flash loan fees set by the owner.

#0 - Shungy

2022-10-24T10:03:30Z

I believe this finding to be technically valid but of lower severity.

My reasoning is stated in a similar finding: https://github.com/code-423n4/2022-10-traderjoe-findings/issues/472#issuecomment-1288454510

#1 - GalloDaSballo

2022-10-27T21:15:58Z

#2 - c4-judge

2022-11-23T18:38:00Z

GalloDaSballo marked the issue as not a duplicate

#3 - c4-judge

2022-11-23T18:39:18Z

GalloDaSballo marked the issue as duplicate of #139

#4 - Simon-Busch

2022-12-05T06:34:21Z

Marked this issue as Satisfactory as requested by @GalloDaSballo

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