Skip to content

Code4rena

Size

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

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

Disclosed reports

Newest first. Only what Size chose to make public.

Business logic

Users may incur an unexpected fragmentation fee in the compensate() call

The compensate() function lacks a minimum-amount parameter, so a borrower may pay an unexpected fragmentation fee if another transaction changes the credit position before their call executes. A malicious user could front-run to cause this fee.

Size

Medium
Business logic

withdraw() users may can’t withdraw underlyingBorrowToken properly

The withdraw function incorrectly applies a collateral ratio check to borrowed tokens, which do not affect the collateral ratio. This can prevent users from withdrawing their borrowed tokens if a slight price fluctuation causes the check to fail, even though they are far from liquidation.

Size

Medium
Business logic

The collateral remainder cap is incorrectly calculated during liquidation

The liquidation function incorrectly calculates the collateral remainder cap by using the full liquidation collateral ratio instead of the excess over 100%, causing users with higher collateral ratios to lose more collateral to the protocol. An attacker could exploit this to unfairly penalise users with higher collateral ratios, discouraging healthy collateralisation.

Size

High
Business logic

Multicall does not work as intended

The multicall function used the contract's own borrowAToken balance instead of the total supply when checking the borrowAToken cap, so the cap check was skipped. An attacker could deposit more borrowAToken than the cap allows, breaking the invariant that borrowAToken supply increase must not exceed debtToken supply decrease.

Size

Medium
Business logic

Users can not to buy/sell minimum credit allowed due to exactAmountIn condition

The validation in buyCreditMarket and sellCreditMarket compared the user's cash amount directly against the minimum credit threshold, so users could not buy or sell the minimum allowed credit when using exactAmountIn. This caused valid transactions to revert with CREDIT_LOWER_THAN_MINIMUM_CREDIT.

Size

Medium
Business logic

Credit can be sold forcibly as forSale setting can be ignored via Compensate

A borrower can force the sale of a lender's credit position even when the lender has set it as not for sale, by using the Compensate function with a reserved ID to create a new credit position that is for sale. This allows the borrower to sell the lender's credit at a profit if market conditions are favourable, though the lender does not suffer a direct loss.

Size

Medium
Business logic

LiquidateWithReplacement does not charge swap fees on the borrower

The LiquidateWithReplacement function does not charge a swap fee to the borrower when it buys credit, unlike the equivalent BuyCreditMarket function. This means borrowers whose credit is purchased via liquidation avoid a fee that others pay, creating an unfair advantage.

Size

Medium
Business logic

Borrower is not able to compensate his lenders if he is underwater

The compensate function reverts if the borrower is still underwater after a single call, preventing a borrower from using multiple healthy credit positions to gradually improve their collateral ratio. An attacker could not exploit this directly, but the borrower is forced to sell credit positions quickly, potentially at a bad price, to avoid liquidation.

Size

Medium
Business logic

Incompatibility with fee-on-transfer/inflationary/deflationary/rebasing tokens, on both base tokens and quote tokens, with varying impacts

The SizeSealed contract does not correctly handle ERC20 tokens whose balances change unexpectedly, such as fee-on-transfer or rebasing tokens. For base tokens, fee-on-transfer tokens make the contract unusable, and rebasing tokens can lock funds; for quote tokens, fee-on-transfer tokens can cause a denial of service or fund loss, and rebasing tokens can lock funds.

Size

Medium
DoS

Denial of service when baseAmount is equal to zero

A bidder could submit an encrypted bid whose decrypted base amount is zero, causing the finalize function to divide by zero and revert. This makes the auction impossible to finalize, denying service to the seller and other participants.

Size

Medium
DoS

Attacker may DOS auctions using invalid bid parameters

Bids in a sealed-bid auction contract were not validated for their public key, commitment or encrypted base amount, so a bidder could submit bids that the finalize loop silently skips. An attacker could fill all 1000 bid slots with such invalid bids and prevent the auction from being finalised, denying service to the seller and honest bidders.

Size

Medium
Business logic

The sorting logic is not strict enough

The auction finalisation sorted bids by a rounded price ratio, so two bids with slightly different true ratios could be treated as equal. The seller could then be forced to accept a lower total quote amount than a better bid would have provided.

Size

Medium
Race condition

Auction created by ERC777 Tokens with tax can be stolen by re-entrancy attack

The createAuction function in the SizeSealed contract lacks re-entrancy protection. An attacker can use a taxed ERC777 token as the base token and, via a malicious ERC777 sender hook, re-enter createAuction to create multiple auctions whose total base amount exceeds the tokens actually received, allowing them to later withdraw more funds from the contract's global pool.

Size

Medium
Business logic

Attacker can steal any funds in the contract by state confusion (no preconditions)

The auction contract uses the user-controlled lowestQuote value to determine whether an auction has been finalised. An attacker can set lowestQuote to its maximum value during finalisation, causing the contract to treat the auction as unfinalised and allowing both the seller and bidder to cancel and recover their funds, resulting in a profit.

Size

High
Business logic

Bidders might fail to withdraw their unused funds after the auction was finalized because the contract doesn’t have enough balance.

The auction contract calculates the seller's payment using a single rounding of the clearing price, while each bidder's refund is calculated with separate roundings, so the seller can receive more quote tokens than the bidders collectively paid. This leaves the contract short of funds, causing the last bidder's withdrawal to fail.

Size

High