handleExecutedDecreaseInvestOrder may revert in some cases #471
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-32
grade-b
Q-22
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/InvestmentManager.sol#L291
Vulnerability details
Impact
Users can request decreasing the outstanding deposit orders via decreaseDepositRequest which will send a cross-chain message to the Centrifuge chain. After the message is processed, Centrifuge's bot will decrease the outstanding deposit orders and send another cross-chain message back to the source chain to notify that the request has been processed. This will eventually call handleExecutedDecreaseInvestOrder, which internally transfers the asset from
escrow
touser
viaasset.transferFrom
. Assets can be tokens with blacklist mechanisms such as USDC and USDT. If the user is blacklisted, it will causeUSDC.transferFrom
revert. Therefore, the message cannot be successfully processed, which means that the user cannot obtain the decreased asset, resulting in a loss of funds.Proof of Concept
When a message of type
Call.ExecutedDecreaseInvestOrder
is executed by relayer, the whole flow is as follows:Let's take a look at the code of
handleExecutedDecreaseInvestOrder
:L291, if
_currency
is USDC or USDT anduser
is blacklisted, tx will revert.Tools Used
Manual Review
Recommended Mitigation Steps
It is recommended not to transfer the asset directly to the user, but to record the amount of the asset and provide the
claim
function to allow the user to specify the receiver.Assessed type
DoS
The text was updated successfully, but these errors were encountered: