Canto Dex Oracle contest - linmiaomiao's results

Execution layer for original work.

General Information

Platform: Code4rena

Start Date: 07/09/2022

Pot Size: $20,000 CANTO

Total HM: 7

Participants: 65

Period: 1 day

Judge: 0xean

Total Solo HM: 3

Id: 159

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 4/65

Findings: 3

Award: $1,530.37

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: hickuphh3

Also found by: Critical, __141345__, linmiaomiao, sorrynotsorry

Labels

bug
duplicate
3 (High Risk)
edited-by-warden

Awards

7507.8311 CANTO - $1,212.51

External Links

Lines of code

https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L501 https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L505

Vulnerability details

Impact

Hardcoded prices of stablecosins may open some arbitrage opportunities and produce many bad loans in CLM.

Proof of Concept

Hardcoding price of cUSDT and cUSDC as 1 may open some arbitrage opportunities when real price for each token is a little bit different, and user can borrow more than it actual amount in Canto Lending Market . Also, in case of UST-style collapse, there are exist many bad loans in CLM.

Tools Used

Webstorm

Don't hardcode cUSDT Price to 1.

#0 - nivasan1

2022-09-09T19:12:00Z

duplicate #73

Findings Information

🌟 Selected for report: hickuphh3

Also found by: 0xNazgul, 0xSky, CertoraInc, Deivitto, Jeiwan, SinceJuly, hansfriese, linmiaomiao, rbserver

Labels

bug
duplicate
2 (Med Risk)

Awards

664.9949 CANTO - $107.40

External Links

Lines of code

https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L581-L584

Vulnerability details

Impact

when calculating token0TVL,it first divide the decimal and then multiplty reserve,it will cause loss of precision and will make LP token price wrong.

Proof of Concept

it calculate token0TVL use :

token0TVL = assetReserves[i] * (prices[i] / decimals)

It first divide the decimal and then multiplty reserve ,and it will result in a loss of price decimal.The result is token0TVL will be much less than the actual value, finally it will cause LPtoken price wrong.

Tools Used

Webstorm

please calculate like this:

token0TVL = assetReserves[i] * prices[i] / decimals

#0 - nivasan1

2022-09-08T21:25:02Z

duplicate of #41

Findings Information

🌟 Selected for report: Chom

Also found by: 0xSmartContract, Jeiwan, SinceJuly, V_B, cccz, linmiaomiao

Labels

bug
duplicate
2 (Med Risk)
edited-by-warden

Awards

1303.145 CANTO - $210.46

External Links

Lines of code

https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L491 https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L498 https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L501 https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-periphery.sol#L505

Vulnerability details

Impact

it compare symbol to identify token,it can be exploit to produce fake price of token.

Proof of Concept

attacker can create a token which is like cToken and has symbol of cNOTE .When somebody call comptroller’s liquidateCalculateSeizeTokens ,it will give an unlisted token with other token(it can be unlisted token or listed token) collateral number.If there are other contracts without whitelist of token and use this price oracle, it will be exploit to produce faked price. It produce a not official hardcode token's price is also a wrong logic.

Tools Used

Webstorm

use address instead of symbol to identify token

#0 - nivasan1

2022-09-10T17:21:24Z

duplicate #24

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