Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash - 1:1 price is assumed b/w stETH and WETH #269

Closed
sherlock-admin3 opened this issue Jun 27, 2024 · 0 comments
Closed

hash - 1:1 price is assumed b/w stETH and WETH #269

sherlock-admin3 opened this issue Jun 27, 2024 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin3
Copy link
Contributor

sherlock-admin3 commented Jun 27, 2024

hash

Medium

1:1 price is assumed b/w stETH and WETH

Summary

1:1 price is assumed b/w stETH and WETH

Vulnerability Detail

The oracle used for WETH is the constantPriceOracle which returns 1e18 as the price. For vault with wstETH and WETH as underlying tokens and WETH as the base asset, the price used for wstETH is the wstETH to stETH exchange ratio

link

    function getAnswer() public view returns (int256) {
        return int256(IWSteth(wsteth).getStETHByWstETH(10 ** decimals));
    }


    function latestRoundData()
        public
        view
        override
        returns (uint80, int256, uint256, uint256, uint80)
    {
        return (0, getAnswer(), block.timestamp, block.timestamp, 0);
    }

This assumes a 1:1 price relation for weth and steth which need not be true as steth can deviate from the weth price. Hence the valuation of the assets will be incorrect allowing user's to possibly gain from the price difference

For eg: if deposit ratio is [100,0:wstETH,weth], withdraw ratio is [0,100:wstETH,weth] and the price of steth drops, user can gain by depositng wstETH and withdrawing weth

Impact

Incorrect valuation of assets which will be used during deposits and withdrawals to determine the assets to be given out

Code Snippet

Tool used

Manual Review

Recommendation

Use eth/steth oracle instead of assuming 1:1 price relation

Duplicate of #266

@sherlock-admin4 sherlock-admin4 changed the title Expert Glossy Bull - stEth deposits will result in a revert 1:1 price is assumed b/w stETH and WETH Jun 28, 2024
@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Jun 30, 2024
@github-actions github-actions bot changed the title 1:1 price is assumed b/w stETH and WETH Curved Powder Rooster - 1:1 price is assumed b/w stETH and WETH Jul 6, 2024
@github-actions github-actions bot closed this as completed Jul 6, 2024
@github-actions github-actions bot added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 6, 2024
@sherlock-admin3 sherlock-admin3 changed the title Curved Powder Rooster - 1:1 price is assumed b/w stETH and WETH hash - 1:1 price is assumed b/w stETH and WETH Jul 15, 2024
@sherlock-admin3 sherlock-admin3 added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 15, 2024
@WangSecurity WangSecurity added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 30, 2024
@Evert0x Evert0x added Medium A valid Medium severity issue and removed Medium A valid Medium severity issue labels Jul 30, 2024
@sherlock-admin4 sherlock-admin4 added Reward A payout will be made for this issue and removed Non-Reward This issue will not receive a payout labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

4 participants