InsureDAO contest - loop'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: 15/37

Findings: 4

Award: $987.75

🌟 Selected for report: 2

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: loop

Also found by: p4st13r4, ye0lde

Labels

bug
3 (High Risk)
resolved
sponsor confirmed

Awards

1025.8688 INSURE - $359.05

622.8489 USDC - $622.85

External Links

Handle

loop

Vulnerability details

The function unlock() in PoolTemplate has a typo where it compares insurances[_id].status to false rather than setting it to false. If the conditions are met to unlock the funds for an id, the user should be able to call the unlock() function once for that id as insurances[_id].amount is subtracted from lockedAmount. However, since insurances[_id].status does not get set to false, a user can call unlock() multiple times for the same id, resulting in lockedAmount being way smaller than it should be since insurances[_id].amount is subtracted multiple times.

Impact

lockedAmount is used to calculate the amount of underlying tokens available for withdrawals. If lockedAmount is lower than it should be users are able to withdraw more underlying tokens than available for withdrawals.

Proof of Concept

Typo in unlock():

Calculation of underlying tokens available for withdrawal:

Change insurances[_id].status == false; to insurances[_id].status = false;

#1 - 0xean

2022-01-27T21:32:25Z

upgrading to sev-3 based on assets being compromised.

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