Skip to content
Business logic Audit finding Intermediate

`PreviewRedeem` may under-price the value of the asset

The previewRedeem function uses the zero address to look up partner fee information, which may return incorrect fee values. This could cause users to be liquidated earlier than they should be and give liquidators higher profits.

GalloDaSballo Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-01-sentiment-judging/issues/19

Found by

GalloDaSballo

Summary

previewRedeem will return an incorrect result based on address(0)

If you get the partnership the fee changes, the address could change the value This may enable: Unfairer (bps wise), liquidations when they shouldn't happen, also will enable marginally higher profit for liquidators as they may be able to benefit from the reduction of the fee

Vulnerability Detail

Impact

A user may get liquidated earlier, and the accounting would be incorrect

Code Snippet

https://arbiscan.io/address/0x13f0d29b5b83654a200e4540066713d50547606e#code

Solidity
  function previewRedeem(address _addr, uint256 _shares)
    external
    view
    returns (
      uint256 _exitFeeLessRebate,
      uint256 _rebateAmount,
      uint256 _assetsLessFee
    )
  {
    PartnerInfo memory partner = partners[_addr];
    uint256 exitFee = partner.isActive ? partner.exitFee : defaultExitFee;
    uint256 rebate = partner.isActive ? partner.rebate : defaultVaultRebate;
    uint256 assets = IERC4626(vault).previewRedeem(_shares);

    uint256 _exitFee;
    (_exitFee, _assetsLessFee) = _calculateFee(assets, exitFee);
    (_rebateAmount, _exitFeeLessRebate) = _calculateFee(_exitFee, rebate);
  }

Tool used

Manual Review

Recommendation

Use the account to determine the price

The original report as published on Sherlock, by GalloDaSballo. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

A user may get liquidated earlier, and the accounting would be incorrect; liquidators could also profit more from the reduced fee.

What the attacker needed

Partnership with a different fee; user has a position that can be liquidated

The fix

The function should use the actual account address to determine the fee instead of the zero address.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a smart contract bug where a function that calculates fees uses the wrong address (the zero address) to look up a partner's fee settings. Because of that, the fee calculation can be wrong, which might make a user's account appear less valuable and trigger an early liquidation.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by GalloDaSballo

View all

30 more disclosed reports, best first.

More from Sentiment Update #3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.