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

Malicious protocol owner can steal all users funds (Centralization risk) #153

Closed
code423n4 opened this issue Dec 13, 2022 · 5 comments
Closed
Labels
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 duplicate-377 edited-by-warden satisfactory satisfies C4 submission criteria; eligible for awards sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

code423n4 commented Dec 13, 2022

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/b2ebb8ea1def4927a747e7a185174892506540ab/contracts/Trading.sol#L926-L933

Vulnerability details

Impact

The Tigris protocol does not have enough boundary conditions that prevent a malicious owner to steal users' funds.
By using some onlyOwner actions, it is possible, for example, to call Trading.setMaxWinPercent to any arbitrary value, including one greater than 100%, which would make it possible to open a position and close it with an arbitrarily high payout, allowing it to steal all the vault's funds.

Even if we trust the protocol owner, we believe this is an unnecessary and serious centralization risk. A malicious or compromised owner address can take advantage of this, and steal all the funds from the protocol.

Proof of Concept

  1. Alice, a malicious protocol owner, opens a position, and immediately calls for Trading.setMaxWinPercent, setting the max win percent as an extremely large number, enough to empty the whole vault.
  2. As a result, all the users' funds from the protocol are drained.

Tools Used

Manual analysis

Recommended Mitigation Steps

Impose boundary checks for all owner-controlled actions. For example, a maximum value for maxWinPercent. Review other functions with onlyOwner modifier and validate if the scope of these actions can be limited in order to reduce the damage of a potential incident.

@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 13, 2022
code423n4 added a commit that referenced this issue Dec 13, 2022
@TriHaz
Copy link

TriHaz commented Dec 26, 2022

We are aware of the centralization risks, owner of all contracts will be the multi-sig treasury for now, until we have a fully decentralized DAO.

@c4-sponsor c4-sponsor added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Dec 26, 2022
@c4-sponsor
Copy link

TriHaz marked the issue as sponsor acknowledged

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as duplicate of #377

@GalloDaSballo
Copy link

Admin privilege risk

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 duplicate-377 edited-by-warden satisfactory satisfies C4 submission criteria; eligible for awards sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

5 participants