Open code423n4 opened 1 year ago
Will most likely make this the main Admin Privilege and bulk every other one under it
We are aware of the centralization risks, owner of contracts will be a timelock and owner will be a multi sig to reduce the centralization for now until it's fully controlled by DAO.
TriHaz marked the issue as sponsor acknowledged
TriHaz marked the issue as disagree with severity
GalloDaSballo changed the severity to 2 (Med Risk)
GalloDaSballo marked the issue as primary issue
Missing setFees, but am grouping generic reports under this one as well
Also missing changes to Trading Extension and Referral Fees
This report, in conjunction with #648 effectively covers all "basic" admin privilege findings, more nuanced issues are judged separately
GalloDaSballo marked the issue as satisfactory
GalloDaSballo marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/Trading.sol#L222-L230 https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/StableVault.sol#L78-L83 https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/StableToken.sol#L38-L46 https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/PairsContract.sol#L48
Vulnerability details
The project heavily relies on nodes/oracles, which are EOAs that sign the current price. Since all functions (including withdrawing) require a recently-signed price, the owner(s) of those EOA can freeze all activity by not providing signed prices.
I got from the sponsor that the owner of the contract is going to be a timelock contract. However, once the owner holds the power to pause withdrawals - that nullifies the timelock. The whole point of the timelock is to allow users to withdraw their funds when they see a pending malicious tx before it's executed. If the owner has the power to freeze users' funds in the contract, they wouldn't be able to do anything while the owner executes his malicious activity.
Besides that, there are also LP funds, which are locked to a certain period, and also can't withdraw their funds when they see a pending malicious timelock tx.
Impact
The owner (or attacker who steals the owner's wallet) can steal all user's funds.
Proof of Concept
StableToken.setMinter()
, mint more tokens, and redeem them viaStableVault.withdraw()
StableVault
, deposit it and withdraw real stablecoinmaxOi
and opening position in the same txRecommended Mitigation Steps