Canto Dex Oracle contest - SinceJuly'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: 9/65

Findings: 3

Award: $357.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

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#L582

Vulnerability details

Impact

When calculating token0TVL, the devision of decimal and price is before the multiplication of reserve, which will cause loss of precision and will make LP token price wrong.

Proof of Concept

The token0TVL is calculated using
token0TVL = assetReserves[i] * (prices[i] / decimals)
Solidity operates only with integers. Thus, if the division is done before the multiplication, the rounding errors can increase dramatically, resulting in the wrong LP Token price.

Tools Used

Visual Studio Code

It is recommended to perform multiplication before division to avoid precision loss. token0TVL = assetReserves[i] * prices[i] / decimals

#0 - nivasan1

2022-09-08T21:34:03Z

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)
disagree with severity

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#L490-#L509

Vulnerability details

Impact

Proof of Concept

An exploiter may create a fake tokens whose symbols are cNOTE, cUSDT or cUSDC. When somebody call computrolle’s liquidateCalculateSeizeTokens ,it will give an unlisted token with other token's (it can be unlisted token or listed token) collateral number. If there are other contracts without whitelist of tokens and use Canto as its price oracle, getUnderlyingPrice will be exploited to produce fake price.

Tools Used

Visual Studio Code

Consider using the address instead of symbol to identify them.

#0 - nivasan1

2022-09-10T00:03:27Z

the getUnderlyingPrice method in the router is only meant to be used by the comptroller. In this case, for a cToken to be priced incorrectly, chain governance would need to vote to support the cToken in the Comptroller. In which case a co-ordinated attack is very unlikely.

#1 - nivasan1

2022-09-10T17:21:49Z

duplicate #24

UNUSED INTERNAL FUNCTION

HARDCODED PRICES FOR STABLECOINS

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