Skip to content

Sherlock

Debita Finance V3

Every publicly disclosed report for Debita Finance V3 and what kind of bugs they were.

disclosed reports
27
most reported class
Business logic
bug classes found
5
first disclosure
2024
Find Debita Finance V3 on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Debita Finance V3 chose to make public.

Audit finding

Mixed Token Price Will Be Inflated or Deflated

The MixOracle::getThePrice() function uses the wrong token decimals when scaling the price, causing inflated or deflated prices for token pairs with different decimal scales. An attacker could exploit this to cause loss of funds for users or systems relying on the oracle.

Debita Finance V3

Medium
Business logic

Lend offer can be deleted multiple times

A lend offer in perpetual mode with zero available amount can be deleted multiple times because the changePerpetual function does not set isActive to false. This repeatedly decrements activeOrdersCount, eventually preventing other lend offers from being deleted.

Debita Finance V3

Medium
Business logic

Borrower can obtain principle tokens without paying collateral tokens

A borrower could obtain principal tokens without paying any collateral because the collateral calculation rounds down to zero for small loan amounts. By exploiting this rounding error, an attacker could repeatedly borrow small amounts and drain the protocol's funds.

Debita Finance V3

Medium
Business logic

No one can sell `TaxTokensReceipts` NFT receipt to the buy order

The TaxTokensReceipt NFT contract overrides transferFrom to only allow transfers involving borrow orders, lend orders, or loans, but not buy orders. As a result, holders cannot sell their TaxTokensReceipt NFTs to a buy order, breaking that feature.

Debita Finance V3

High
Business logic

The fee calculation in extendLoan function has a error

The extendLoan function calculates the fee for extending a loan using the absolute deadline timestamp instead of the extended duration, which can cause borrowers to pay more fees than necessary. An attacker could exploit this to cause financial loss to users, though the report does not specify an attack path.

Debita Finance V3

Medium
Race condition

An attacker can wipe the orderbook in buyOrderFactory.sol

The sellNFT function in buyOrder.sol lacks reentrancy protection, allowing a malicious contract to repeatedly call it and delete multiple buy orders. This temporarily blocks the orderbook, preventing users from viewing, deleting, or selling positions.

Debita Finance V3

Medium
Business logic

Nobody can buy the `TaxTokenReceipt` NFT from auction

The TaxTokenReceipt NFT contract overrides transferFrom to require that either the sender or receiver is a Debita contract (BorrowOrder, LendOrder, or Loan). When a loan is auctioned, the NFT is held by the Auction contract, which is not one of those, so nobody can buy it, locking the collateral and causing lenders to lose funds.

Debita Finance V3

High
Business logic

Incorrect calculation of extended loan days leads to unfair borrower fees

The extendLoan function calculates the fee for extending a loan using the offer's maximum deadline instead of the actual extended period, leading to inflated fees. Borrowers are charged more than they should be when extending their loans.

Debita Finance V3

Medium
DoS

Attacker will prevent lenders from canceling lend orders and block non-perpetual lend orders matching

The addFunds function in DLOImplementation lacks a check that the lend order is active, allowing an attacker to add funds to a cancelled order and then cancel it again, repeatedly decrementing the factory's activeOrdersCount until it reaches zero. This causes deleteOrder to revert with an arithmetic underflow, blocking all lenders from cancelling their orders and preventing non-perpetual lend orders from being fully matched.

Debita Finance V3

Medium
Business logic

Auctioned `taxTokensReceipt` NFT Blocks Last Claimant Due to Insufficient Funds

The auction contract does not account for fee-on-transfer tokens when buying a taxTokensReceipt NFT, so the loan contract receives less than the expected amount. This causes the last lender claiming collateral to be unable to withdraw due to insufficient funds.

Debita Finance V3

Medium
Business logic

A borrower may pay more interest that he has specified, if orders are matched by a malicious actor

The matchOffersV3 function allows anyone to match borrow and lend orders, and a malicious matcher can split a large lend order into many tiny amounts with a higher APR, causing the borrower to pay more interest than the specified maximum APR on a portion of the principal. This results in the borrower overpaying interest, and the attacker can profit if they provide the higher-APR lend order.

Debita Finance V3

Medium
Audit finding

The `MixOracle.getThePrice` function calculates the price incorrectly using the `TarotOracle.getResult` function as the TWAP price

The MixOracle.getThePrice function uses TarotOracle.getResult as the TWAP price, but that function returns a cumulative value rather than a time-weighted average. This causes the oracle to report a price that is orders of magnitude too high, disrupting the matching of lend and borrow orders and potentially causing user loss of funds.

Debita Finance V3

Medium
Business logic

Users can be griefed due to lack of minimum size within the Loan and Offer

The protocol lacked a minimum size for loans and offers, allowing a malicious aggregator to split a user's borrow offer into many tiny loans and offers. This could overwhelm the user and force them to pay excessive gas to manage or claim their funds.

Debita Finance V3

Medium
Business logic

Incentive Creator's Tokens Permanently Locked in Zero-Activity Epochs

The DebitaIncentives contract lacks a mechanism to recover incentive tokens deposited for a future epoch if no lending or borrowing activity occurs during that epoch. As a result, incentive creators permanently lose their tokens, which remain locked in the contract.

Debita Finance V3

Medium
Smart contracts

Loan Extension Fails Due to Unused Time Calculation

The extendLoan function in DebitaV3Loan contains an unused variable extendedTime that can cause an arithmetic underflow when a borrower tries to extend a loan near its deadline. This reverts the transaction, preventing borrowers from extending their loans even when they meet all other requirements.

Debita Finance V3

Medium