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

0x52 - First depositor can abuse exchange rate to steal funds from later depositors #125

Open
github-actions bot opened this issue Mar 10, 2023 · 4 comments
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability High A valid High 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

0x52

medium

First depositor can abuse exchange rate to steal funds from later depositors

Summary

Classic issue with vaults. First depositor can deposit a single wei then donate to the vault to greatly inflate share ratio. Due to truncation when converting to shares this can be used to steal funds from later depositors.

Vulnerability Detail

See summary.

Impact

First depositor can steal funds due to truncation

Code Snippet

https://github.com/sherlock-audit/2023-02-surge/blob/main/surge-protocol-v1/src/Pool.sol#L307-L343

Tool used

Solidity YouTube Tutorial

Recommendation

Either during creation of the vault or for first depositor, lock a small amount of the deposit to avoid this.

@github-actions github-actions bot added Has Duplicates A valid issue with 1+ other issues describing the same vulnerability High A valid High severity issue labels Mar 10, 2023
This was referenced Mar 10, 2023
This was referenced Mar 10, 2023
@0xMoaz
Copy link

0xMoaz commented Mar 12, 2023

GG. We left this one intentionally. Glad to see this many duplicates.

@0xMoaz 0xMoaz added Will Fix The sponsor confirmed this issue will be fixed Sponsor Confirmed The sponsor acknowledged this issue is valid labels Mar 12, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Mar 26, 2023
@0xMoaz
Copy link

0xMoaz commented Jun 2, 2023

Fixed

@0xMoaz
Copy link

0xMoaz commented Jun 3, 2023

@IAm0x52
Copy link
Collaborator

IAm0x52 commented Jun 19, 2023

Fix looks good. First deposit now creates a minimum liquidity that make advantageous manipulation nearly impossible

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability High A valid High 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