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

Protocol is served as zero-slippage liquidity pool for stable coins #483

Closed
code423n4 opened this issue Dec 16, 2022 · 6 comments
Closed
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-462 nullified Issue is high quality, but not accepted upgraded by judge Original issue severity upgraded from QA/Gas by judge

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/StableVault.sol#L27

Vulnerability details

Impact

Currently, protocol allows swap between stable coins like USDT, DAI, tigUSD at rate 1-1 all the time. While in reality, value of these tokens are not stayed the same, even for USDT-USDC, USDC usually has higher value than USDT.

Serving as zero-slippage pool for stable coins will usually make depositors losing funds and left the pool with single token. Everyone will deposit low value token and withdraw high value one. And the result is honest users, who only deposit tokens to Vault without acknowledge this is usually the one suffering loss.

Also, it increased the chance of tigUSD got depegged because to be honest, it's a new token with lowest trust among these stable coins so most of the time, Vault will only contains tigUSD.

Proof of Concept

Consider the scenario

There is a StableVault that support both USDC and DAI. Assume 1 DAI = 0.998 USDC

  1. Alice deposit 1000 DAI to Stable Vault.
  2. Alice withdraw 1000 USDC from Stable Vault.
  3. Profit = 1000 USDC - 1000 DAI = 1000 - 0.998 * 1000 = 2 USDC

Tools Used

Manual Review

Recommended Mitigation Steps

Consider only allowing users withdraw the exact token they deposited

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Dec 16, 2022
code423n4 added a commit that referenced this issue Dec 16, 2022
@GalloDaSballo
Copy link

Lack of Liquidity Premium report, definitely agree

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as duplicate of #462

@c4-judge c4-judge added duplicate-462 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Dec 20, 2022
@c4-judge
Copy link
Contributor

GalloDaSballo changed the severity to 3 (High Risk)

C4-Staff added a commit that referenced this issue Jan 6, 2023
@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jan 22, 2023
@GalloDaSballo
Copy link

Invalidating due to Warden being in breach of the Rules

@c4-judge c4-judge added nullified Issue is high quality, but not accepted and removed satisfactory satisfies C4 submission criteria; eligible for awards labels Jan 30, 2023
@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as nullified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-462 nullified Issue is high quality, but not accepted upgraded by judge Original issue severity upgraded from QA/Gas by judge
Projects
None yet
Development

No branches or pull requests

3 participants