-
Notifications
You must be signed in to change notification settings - Fork 14
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
Unchecked Return Values of PoolManager::isAllowedAsPoolCurrency() #246
Comments
raymondfam marked the issue as low quality report |
raymondfam marked the issue as duplicate of #68 |
gzeon-c4 marked the issue as unsatisfactory: |
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as unsatisfactory: |
gzeon-c4 changed the severity to QA (Quality Assurance) |
isAllowedAsPoolCurrency revert if false, but as QA the bool should be checked |
hieronx (sponsor) confirmed |
gzeon-c4 marked the issue as grade-b |
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/InvestmentManager.sol#L124, https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/InvestmentManager.sol#L154
Vulnerability details
Impact
The interface used in src\InvestmentManager.sol
function returns
bool
, but the check is not executed.Token (
currency
) that is not supported in Centrifuge pool will be used in InvestmentManager::requestRedeem() and InvestmentManager::requestDeposit().In other contracts, the check is performed. In this case, it was probably forgotten to be performed.
Line 124:
poolManager.isAllowedAsPoolCurrency(lPool.poolId(), currency);
Line 154:
poolManager.isAllowedAsPoolCurrency(lPool.poolId(), lPool.asset());
Proof of Concept
At the moment PoolManager::isAllowedAsPoolCurrency() will always return
true
orrevert()
will occur. But if the PoolManager logic is changed so thattrue
/false
is returned and theaddress poolManager
is updated with InvestmentManager::file(), the Token (currency
) that is not supported in Centrifuge pool will be used in InvestmentManager::requestRedeem() and InvestmentManager::requestDeposit().Tools Used
Manual analysis
Recommended Mitigation Steps
Change from
Line 124:
poolManager.isAllowedAsPoolCurrency(lPool.poolId(), currency);
Line 154:
poolManager.isAllowedAsPoolCurrency(lPool.poolId(), lPool.asset());
to
Line 124:
requre(poolManager.isAllowedAsPoolCurrency(lPool.poolId(), currency), "PoolManager/currency-not-supported")
Line 154:
requre(poolManager.isAllowedAsPoolCurrency(lPool.poolId(), lPool.asset()), "PoolManager/currency-not-supported")
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: