-
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
The Restriction Manager does not completely implement ERC1404 which leads to account that are supposed to be restricted actually have access to do with their tokens as they see fit #779
Comments
raymondfam marked the issue as low quality report |
raymondfam marked the issue as duplicate of #233 |
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as unsatisfactory: |
This is a design decision. Transferring to a valid member is fine if that destination is still allowed to hold the tokens. |
This seems to contradict with |
gzeon-c4 removed the grade |
Yes you're right, that's unfortunate wording. What I said above is correct, and the text in the README is incorrect. What was meant was that it locks their tranche tokens from being redeemed. It is indeed fair to say though that based on the README text, the above issue is valid. |
gzeon-c4 marked the issue as primary issue |
gzeon-c4 marked the issue as satisfactory |
gzeon-c4 marked the issue as selected for report |
Mitigated in centrifuge/liquidity-pools#138 |
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/token/RestrictionManager.sol#L28-L34
Vulnerability details
Impact
Medium, contract's intended logic is for blacklisted users not to be able to interact with their system so as to follow rules set by regulationary bodies in the case where a user does anything that warrants them to be blacklisted, but this is clearly broken since only half the window is closed as current implementation only checks on receiver being blacklisted and not sender.
Proof of Concept
The current implementation of the ERC1404 restrictions within the
RestrictionManager.sol
contract only places restrictions on the receiving address in token transfer instances. This oversight means that the sending addresses are not restricted, which poses a regulatory and compliance risk. Should a user beblacklisted
for any reason, they can continue to transfer tokens as long as the receiving address is a valid member. This behaviour is contrary to expectations from regulatory bodies, especially say in the U.S where these bodies are very strict and a little in-compliance could land Centrifuge a lawsuit., which may expect complete trading restrictions for such blacklisted individuals.Within the
RestrictionManager
contract, the methoddetectTransferRestriction
only checks if the receiving address (to
) is a valid member:RestrictionManager.sol#L28-L34
In the above code, the sending address (
from
) is never checked against the membership restrictions, which means blacklisted users can still initiate transfers and when checking the transfer restriction from bothtranchtoken.sol
and theliquiditypool.sol
it's going to wrongly return true for a personnel that should be falseSee Tranche.sol#L80-L82)
Also Tranche.sol#L35-L39
This function suggests that the system's logic may rely on the
detectTransferRestriction
method in other parts of the ecosystem. Consequently, if the restriction manager's logic is flawed, these other parts may also allow unauthorised transfers.Foundry POC
Add this to the
Tranche.t.sol
contractAs seen even after
address(this)
stops being a member they could still transfer tokens to another user in as much as said user is still a member, which means a blacklisted user could easily do anything with their tokens all they need to do is to delegate to another member.Tool used
Manual Review
Recommended Mitigation Steps
Refactor
detectTransferRestriction()
, i.e modify the method to also validate the sending address (from
). Ensure bothfrom
andto
addresses are valid members before allowing transfers.If this is contract's intended logic then this information should be duly passed to the regulatory bodies that a
user
can't really get blacklisted and more of user's could be stopped from receiving tokens.Assessed type
Context
The text was updated successfully, but these errors were encountered: