Skip to content

Code4rena

Revert Lend

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

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

Disclosed reports

Newest first. Only what Revert Lend chose to make public.

Race condition

Risk of reentrancy onERC721Received function to manipulate collateral token configs shares

The vault's onERC721Received function calls _cleanupLoan before updating collateral, and _cleanupLoan transfers the old NFT back to the owner, triggering a callback. A malicious owner can reenter borrow during that callback, causing _updateAndCheckCollateral to run twice and inflate the vault's total debt shares, which can block other borrowers.

Revert Lend

High
Smart contracts

_getReferencePoolPriceX96() will show incorrect price for negative tick deltas in current implementation cause it doesn’t round up for them

The oracle's TWAP calculation rounded a negative tick delta toward zero instead of down, so the returned tick could be higher than the true time-weighted average. This could produce an incorrect reference price, potentially letting unhealthy loans appear healthy or affecting swap enablement in the automator.

Revert Lend

High
DoS

Owner of a position can prevent liquidation due to the onERC721Received callback

When liquidating a position, the protocol calls safeTransferFrom to return the NFT to the borrower, which invokes the borrower's onERC721Received callback. A malicious borrower can make that callback return an invalid value, causing the transfer to revert and preventing liquidation.

Revert Lend

High
DoS

Protocol can be repeatedly gas griefed in AutoRange external call

A malicious contract implementing the ERC721 receive callback can burn all gas and revert when the AutoRange bot transfers a newly minted NFT to it, causing the bot's execute transaction to fail. Because the token config is only cleared at the end of execute, the griefing can repeat and drain the off-chain operator's gas budget.

Revert Lend

Medium
Business logic

Users can lend and borrow above allowed limitations

The daily lend and borrow increase limits were calculated incorrectly, allowing users to deposit or borrow up to 110% of the intended limit instead of 10%. An attacker could exceed the daily limits, potentially destabilising the protocol's risk controls.

Revert Lend

Medium
Smart contracts

Large decimal of referenceToken causes overflow at oracle price calculation

The price calculation in V3Oracle.sol overflows when the reference token has 18 decimals and the Chainlink price exceeds a threshold, causing getValue() to revert. This makes the Chainlink price feed unusable, forcing reliance on the TWAP source and reducing pricing security.

Revert Lend

Medium
Business logic

Wrong global lending limit check in _deposit function

The _deposit function compared the total supply of lender shares against the global lending limit instead of converting those shares to their underlying asset value. This allowed more assets to be lent than the protocol's global limit intended.

Revert Lend

Medium
Business logic

V3Vault is not ERC-4626 compliant

The V3Vault contract's maxDeposit, maxMint, maxWithdraw, and maxRedeem functions do not comply with ERC-4626 because they return amounts that would cause a revert when the corresponding deposit, mint, withdraw, or redeem function is called. This could mislead integrating protocols and users, potentially damaging the protocol's brand and limiting growth.

Revert Lend

Medium
DoS

Some ERC20 can revert on a zero value transfer

Some ERC20 tokens revert when a zero-value transfer is attempted, and the contract calls safeTransfer or safeTransferFrom without checking for a zero amount. An attacker could cause transactions to revert by triggering a zero-value transfer, potentially blocking liquidations or other operations.

Revert Lend

Medium
DoS

Tokens can’t be removed as a collateral without breaking liquidations and other core functions

The protocol uses a token's collateral factor of zero to mean it is not accepted as collateral, but setting it to zero for an already-approved token breaks liquidation and health checks because calculations divide by that zero factor. An attacker could not directly exploit this, but the admin action of removing a collateral would cause liquidations to revert, locking funds.

Revert Lend

Medium
Business logic

Asymmetric calculation of price difference

The contract calculates the price difference between the current price and a verified price using two different formulas depending on whether the current price is above or below the verified price. This makes the allowed deviation asymmetric, so a price above the verified price can deviate more than one below it before being rejected.

Revert Lend

Medium
Business logic

AutoRange execution can be front-ran to avoid protocol fee, causing loss for protocol

The AutoRange contract allows users to change their fee-handling preference (onlyFees) after an operator has set the reward parameter, so a user can front-run the operator's transaction to switch to a lower fee mode. This causes the protocol to receive a much smaller fee than intended, leading to a loss.

Revert Lend

Medium
Business logic

dailyDebtIncreaseLimitLeft is not updated in liquidate()

The liquidate() function does not increase the daily debt increase limit counter, unlike repay(), so repaid amounts from liquidations cannot be borrowed again. On days with many large liquidations this leaves excess assets in the vault that cannot be borrowed, sharply lowering the utilisation rate.

Revert Lend

Medium
Business logic

Dangerous use of deadline parameter

The protocol passed the current block timestamp as the deadline to Uniswap position manager calls, which makes the deadline check ineffective. An attacker or MEV bot could hold a pending transaction and execute it later, potentially to the submitter's detriment.

Revert Lend

Medium
Business logic

V3Oracle susceptible to price manipulation

The V3Oracle contract calculates the token amounts of a position using the current spot price from the Uniswap pool, which can be manipulated within a single transaction. An attacker could distort the spot price via a flash loan to inflate or deflate the position value, potentially borrowing or repaying at favourable conditions.

Revert Lend

Medium
Access control

User might execute PositionToken of token set by previous token owner

The AutoRange contract stores a per-token position configuration that is not cleared when the token is transferred to a new owner. A new owner could therefore have their position executed using a configuration set by the previous owner, potentially affecting the swap and the protocol's incentive.

Revert Lend

Medium
Business logic

An attacker can easily bypass the collateral value limit factor checks

The collateral value limit factor checks are not performed when withdrawing lent tokens, so an attacker can supply tokens, borrow against them, and then withdraw the supplied tokens in one transaction to exceed the intended limit. This can also cause calls from the AutoRange automator to revert because the limit is surpassed.

Revert Lend

Medium
Access control

V3Vault::transform does not validate the data input and allows a depositor to exploit any position approved on the transformer

The V3Vault transform function only checks the tokenId parameter for ownership, not the tokenId encoded in the calldata passed to the transformer. Any vault position holder could call an approved transformer with arbitrary parameters to manipulate any position delegated to that transformer, potentially draining funds or causing losses.

Revert Lend

High
Business logic

V3Vault.sol permit signature does not check receiving token address is USDC

The V3Vault contract accepted Permit2 signatures without verifying that the transferred token was USDC, allowing an attacker to use a permit for any ERC20 token and have it treated as USDC. This could let an attacker deposit a worthless token and steal USDC from the vault.

Revert Lend

High
Business logic

Users cannot stop loss in AutoRange and AutoExit

The AutoRange and AutoExit contracts call _validateSwap even when amountIn is zero, meaning no swap is intended. This causes transactions to revert when the price deviates from the TWAP by more than the configured threshold, preventing users from withdrawing their tokens and cutting losses.

Revert Lend

Medium
Business logic

setReserveFactor fails to update global interest before updating reserve factor

The setReserveFactor function updates the reserve factor without first updating global interest, so the new reserve factor is applied retroactively to the period since the last interest update. This causes the lending exchange rate to change unexpectedly, giving lenders a slightly different rate than they should have received.

Revert Lend

Medium