Skip to content

Sherlock

Carapace

Every publicly disclosed report for Carapace and what kind of bugs they were.

disclosed reports
21
most reported class
Business logic
bug classes found
3
first disclosure
2023
Find Carapace on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Carapace chose to make public.

Race condition

Sandwich attack to accruePremiumAndExpireProtections()

The function accruePremiumAndExpireProtections() increases the pool's underlying token balance without minting new shares, raising the exchange rate. An attacker can deposit just before this call and withdraw just after to capture a disproportionate share of the premium.

Carapace

High
Business logic

The renewal grace period gives users insurance for no premium

When a protection position is renewed within the grace period, the new insurance starts at the current block timestamp rather than at the previous protection's expiration. This lets a user repeatedly renew at the end of the grace period to obtain free insurance for the grace period's duration.

Carapace

High
Business logic

function lockCapital() doesn't filter the expired protections first and code may lock more funds than required and expired defaulted protections may funded

The lockCapital function in the ProtectionPool contract does not filter out expired protections before calculating the total amount of funds to lock when a lending pool defaults. This can cause more funds to be locked than necessary and expired defaulted protections to be funded, resulting in protection sellers losing more funds.

Carapace

Medium
DoS

Malicious seller forced break lockCapital()

A malicious seller can burn their NFT after buying protection, causing the protocol's lockCapital() function to revert because it calls ownerOf() on a burned token. This prevents the lending pool from moving to a late state, so all protections expire and the seller keeps the premium while buyers lose compensation.

Carapace

High
Business logic

Existing buyer who has been regularly renewing protection will be denied renewal even when she is well within the renewal grace period

The renewal function for existing protection buyers calls a check that rejects any lending pool not in the Active state, so a buyer is denied renewal if the pool becomes LateWithinGracePeriod just after their protection expires, even though they are within the grace period. This means a buyer who has paid premiums can lose all protection exactly when a default risk first appears.

Carapace

High
Business logic

Protection sellers can bypass withdrawal delay mechanism and avoid losing funds when loans are defaulted by creating withdrawal request in each cycle

The withdrawal delay mechanism in a smart contract can be bypassed because the withdrawal request function does not track previous requests, allowing a protection seller to request withdrawal of their full balance in each cycle and then withdraw at the end of the current cycle instead of waiting for the next cycle.

Carapace

High
Business logic

Protection buyer may buy multiple protections for same goldfinch NFT

The Carapace protocol only checked that a single protection did not exceed the loan's remaining principal, but allowed a buyer to purchase multiple protections for the same Goldfinch NFT. An attacker could overprotect a loan position to claim more than they lent on default, or lock all protocol funds to prevent new protections.

Carapace

High
Business logic

secondary markets are problematic with how `lockCapital` works

The `assessState` function can be called by anyone to trigger a pool's transition to the Late state, which snapshots the current sToken holders. An attacker can use a flash loan to acquire sTokens just before this snapshot, then claim a share of any later unlocked capital, stealing from legitimate holders.

Carapace

Medium
Business logic

Protection too expensive when some capital is locked

The leverage ratio is calculated as unlocked capital divided by total protections, so protections that have locked capital are counted twice: once by locking capital and again by increasing the denominator. This can make protection very expensive or impossible to buy even when the pool is well capitalised.

Carapace

Medium
Business logic

Sybil on withdrawal requests can allow leverage factor manipulation with flashloans

A user could request withdrawals from multiple addresses using the same STokens because the balance was checked but not locked, allowing them to temporarily inflate the leverage factor and manipulate premium prices. An attacker could use a flash loan to deposit and withdraw in the same transaction, gaining cheaper premiums and potentially disrupting the protocol.

Carapace

High
Business logic

Lending pool state transition will be broken when pool is expired in late state

The lending pool state machine checks for the Expired state before Late, so a pool that becomes expired while in a late state never unlocks capital, and a pool that becomes expired without a late transition never locks capital. This can leave capital locked forever or prevent protection buyers from being compensated.

Carapace

High
DoS

Too many active protections can cause the ProtectionPool reach the block gas limit

The ProtectionPool contract loops over an unbounded array of protections in two functions, which can cause transactions to exceed the block gas limit and revert. An attacker could stuff the array with many small protections, making critical functions like lockCapital and _accruePremiumAndExpireProtections unusable, potentially denying coverage to buyers.

Carapace

High
Business logic

User can game protection via renewal to get free insurance

The renewal function did not check the amount of protection being renewed, allowing a user to renew for more protection than originally purchased. An attacker could exploit this to obtain full insurance coverage while paying a minimal premium.

Carapace

High