InsureDAO contest - egjlmn1's results

Anyone can create an insurance pool like Uniswap.

General Information

Platform: Code4rena

Start Date: 07/01/2022

Pot Size: $80,000 USDC

Total HM: 21

Participants: 37

Period: 7 days

Judge: 0xean

Total Solo HM: 14

Id: 71

League: ETH

InsureDAO

Findings Distribution

Researcher Performance

Rank: 28/37

Findings: 3

Award: $87.54

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Dravee

Also found by: Fitraldys, Ruhum, WatchPug, danb, egjlmn1, robee

Labels

bug
duplicate
2 (Med Risk)
sponsor acknowledged

Awards

86.5379 INSURE - $30.29

52.5409 USDC - $52.54

External Links

Handle

egjlmn1

Vulnerability details

https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L390

In allocateCredit() an attacker can push into the indexList state variable and in applyCover() and in resume() there is a loop that goes over all the indexes.

An attacker can't just add himself through calling allocateCredit() because there is check that he is listed in the registry. What the attacker can do is create a lot of markets, and each time a market is created it will automatically call allocateCredit() and by doing this the attacker can increase the indexList as much as he wants.

Impact

If the array is too large, the for loop will iterate too many times for any gas amount, which will DOS those function calls. And just waste the gas limit for the users who call those functions

Proof of Concept

once a transaction reaches the gas limit, it will revert.

Tools Used

manual code review

have a cap on the indexList or only allow authorized market to join

#0 - oishun1112

2022-01-14T07:17:05Z

True, but creation of index pool is only allowed to the governance.

#1 - 0xean

2022-01-27T22:09:36Z

dupe of #352

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