Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

GalloDaSballo - PreviewRedeem may under-price the value of the asset #19

Open
github-actions bot opened this issue Jan 24, 2023 · 0 comments
Open
Labels
Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed

Comments

@github-actions
Copy link

GalloDaSballo

medium

PreviewRedeem may under-price the value of the asset

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

  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

@github-actions github-actions bot added the Medium A valid Medium severity issue label Jan 24, 2023
@r0ohafza r0ohafza added Disagree With Severity The sponsor disputed the severity of this issue Will Fix The sponsor confirmed this issue will be fixed and removed Disagree With Severity The sponsor disputed the severity of this issue labels Jan 25, 2023
@hrishibhat hrishibhat added the Sponsor Confirmed The sponsor acknowledged this issue is valid label Jan 28, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed
Projects
None yet
Development

No branches or pull requests

3 participants