UserEscrow
: If the ERC20 token has blacklist, it may cause the fund locking in the contract
#591
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-32
grade-b
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/UserEscrow.sol#L43
Vulnerability details
Impact
If the ERC20 token has blacklist, it may cause the fund locking in the contract
Because
UserEscrow.transferOut()
transfer to the receiver by checkingreceiver == destination || (ERC20Like(token).allowance(destination, receiver) == type(uint256).max)
However, if Alice deposits part of the funds(such as USDC) into the contract. After a while, Alice entered the blacklist,so she can not call the
approve()
of the ERC20 token, so the condition(ERC20Like(token).allowance(destination, receiver) == type(uint256).max
cannot be established, and the funds will lock in the contract.Proof of Concept
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/UserEscrow.sol#L43
Tools Used
manual
Recommended Mitigation Steps
I suggest adding an approve function to the
UserEscrow
contract. The user can specify the approved user through this function, and then functiontransferOut()
can check whether the user has been approvedAssessed type
ERC20
The text was updated successfully, but these errors were encountered: