Mimo DeFi contest - broccolirob's results

Bridging the chasm between the DeFi world and the world of regulated financial institutions.

General Information

Platform: Code4rena

Start Date: 28/04/2022

Pot Size: $50,000 USDC

Total HM: 7

Participants: 43

Period: 5 days

Judge: gzeon

Total Solo HM: 2

Id: 115

League: ETH

Mimo DeFi

Findings Distribution

Researcher Performance

Rank: 11/43

Findings: 1

Award: $1,119.44

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0x1f8b

Also found by: broccolirob, pauliax

Labels

bug
duplicate
2 (Med Risk)
disagree with severity

Awards

1119.4434 USDC - $1,119.44

External Links

Lines of code

https://github.com/code-423n4/2022-04-mimo/blob/main/core/contracts/oracles/BalancerV2LPOracle.sol#L126-L129 https://github.com/code-423n4/2022-04-mimo/blob/main/core/contracts/oracles/GUniLPOracle.sol#L45-L51

Vulnerability details

Impact

The GUniLPOracle.constructor and BalancerV2LPOracle._getNormalizedBalance both assume an asset will never have more than 18 decimals. However, there is no enforced limit for decimals on ERC20 tokens or Chainlink price feed assets. For example, the “Synthetix Aggregator Debt Ratio” feed returns 27 decimals, and the “YAMv2” token has 24 decimals. Adding tokens with more than 18 decimals will cause an underflow that wraps to ~255 which will dramatically overstate the balance of such tokens and feeds.

Proof of Concept

A token similar to YAMv2 is added to Chainlink and a Mimo BalancerV2LPOracle is created for it. Now calls to getAssetPrice() are now broken and dramatically overstating or understating an asset's price relative to EUR.

Tools Used

Manual analysis.

Trigger a revert if decimals are greater than 18.

#0 - m19

2022-05-05T08:52:01Z

We confirm this issue but we don't think it's high risk, it's medium risk. Also a duplicate of #55

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