-
Notifications
You must be signed in to change notification settings - Fork 0
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
Non-whitelisted users can burn UStb and redeem collateral during WHITELIST_ENABLED state #13
Comments
0xEVom marked the issue as primary issue |
The Redeemer has a special role in the protocol and it is seen as a non-issue that UStb can be redeemed from a non-whitelisted address while whitelist mode is enabled. As specified in the Overview the redeem order is determined by and off-chain RFQ system, in which case the Redeemer will not provide a redemption quote if they chose not to. For clarity, a non-whitelisted user cannot redeem collateral without the involvement of the Redeemer, as it is the Redeemer who submits the settlement transaction on-chain. We therefore argue that the likelihood of this happening is low. In addition, the impact to the protocol is low as the collateralization ratio of the minting contract would not be impacted and other users' positions are not impacted. Although this finding is informationally correct, we view the severity to be based on the fact that a non-whitelisted address can initiate a redemption without the involvement of a trusted party within the protocol which is not the case. We suggest marking this finding as Low severity. |
One of the main invariants here was:
The warden could not have known whether the off-chain Redeemer would only submit transactions for whitelisted addresses. Besides, the WHITELIST_MANAGER and the REDEEMER being different entities means there can always be race conditions on address (un-)whitelisting and redemption submission. If the contract must enforce the invariant (which seems to not necessarily be the case), this must be done onchain. But for the purpose of the contest, Medium is appropriate. |
0xEVom marked the issue as satisfactory |
0xEVom marked the issue as selected for report |
@0xEVom! Thanks for your judging. I think this issue should be seen as QA based on the following C4 rule.
Redeemer has a trusted role, that's why redeeming collateral by buring USTB for a unwhitlisted user in the WHITELIST_ENABLED case is a direct misuse of privileges. In README.md: All trusted roles in the protocol:
I submitted this issue for QA as a consequence. |
The redeemer is not expected to enforce the whitelist - that is the WHITELIST_MANAGER, and the smart contract's, responsibility. |
Lines of code
https://github.com/code-423n4/2024-11-ethena-labs/blob/e93ee09b10f900bd3be385f392c80920898bf53e/contracts/ustb/UStb.sol#L189
Vulnerability details
Finding description and impact
Non-whitelisted users can redeem collateral tokens and burn their UStb even when whitelist mode has been enabled on UStb contract. This breaks the main invariant mentioned in the README.
Proof of Concept
The below code block is from the _beforeTokenTransfer() function(), which is called at the beginning of the ERC20 _burn() internal function. When the transferState is WHITELIST_ENABLED, it should only allow whitelisted users to burn their UStb as mentioned under the main invariants in the README. But since the
from
address is not checked to have theWHITELISTED_ROLE
as well, the call goes through.Recommended mitigation steps
Add
hasRole(WHITELISTED_ROLE, from)
in the check.The text was updated successfully, but these errors were encountered: