-
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
User funds can be stuck into escrow forever #32
Comments
raymondfam marked the issue as primary issue |
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as high quality report |
hieronx marked the issue as disagree with severity |
This is a a general issue with blacklisted tokens, and many DeFi protocols will have similar behaviour (a protocol like MakerDAO also does not have such emergency withdraw functions). By adding such a function, centralization risk is significantly increased, which is not worth it. I would consider this |
hieronx (sponsor) acknowledged |
gzeon-c4 changed the severity to QA (Quality Assurance) |
gzeon-c4 marked the issue as grade-b |
I believe that this don't falls under "Low risk" as there is a risk of permanent frozen funds:
Medium severity seems appropriate based on c4 severity categorization:
wdyt @gzeon ? |
I think an external blacklist is clearly out-of-scope. |
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/Escrow.sol#L14-L27
Vulnerability details
Impact
The
Escrow.sol
smart contract receive assets from investors and send back those assets to investors when they withdraw. However some tokens (e.g. USDC, USDT) have a contract level admin controlled address blocklist. If an address is blocked, then transfers to and from that address are forbidden. see hereIf a user invest in a pool using one of those tokens and after get added to blocklist by these tokens owner, the invested funds get trapped into escrow contract forever.
Proof of Concept
Here is an example of blockable token:
https://github.com/d-xo/weird-erc20/blob/04fbd6411f201da59a895dd6d3506913a525dfa9/src/BlockList.sol#L1-L29
As we can see if an address is blocked it can never receive or transfer tokens again. This situation result in user funds being trapped everywhere he invested ( in this case Cantrifuge ).
However Centrifuge did not implement a withdraw function in the
Escrow.sol
contract to allow an emergency withdraw of tokens that can potentially be stuck inside forever.Tools Used
Manual review
Recommended Mitigation Steps
Add an emergency admin withdraw function to withdraw an user funds if he gets blocked by asset contract owner. Here is an example:
For more transparancy this function should only be called by admin after a governance vote.
Assessed type
ERC20
The text was updated successfully, but these errors were encountered: