Open code423n4 opened 2 years ago
It is in consideration that CDS is not locked. CDS is going to be a backup of all indices(means all pools) It is useless if CDS is locked whenever one of the pool is in Payout status in InsureDAO (anyone can create insurance pool) CDS is backup and tends to be used hardly ever, so not necessary to be locked as paying out. Instead, withdraw wait-time may be set longer than default.
Handle
leastwood
Vulnerability details
Impact
The
applyCover()
function locks all index markets in order to ensure compensation is properly accounted for when the insurance pool resumes trading. However, it seems that onlyIndexTemplate.sol
is locked, even though it may potentially make a call toCDSTemplate.sol
for additional compensation to cover the shortage in payout.Proof of Concept
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L655-L686
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/IndexTemplate.sol#L476-L481
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/IndexTemplate.sol#L421-L450
Tools Used
Manual code review.
Recommended Mitigation Steps
Consider propagating market locking to all index markets and all CDS markets.