UStb can be minted to non-whitelisted users during WHITELIST_ENABLED state #14
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
primary issue
Highest quality submission among a set of duplicates
🤖_03_group
AI based duplicate group recommendation
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-11-ethena-labs/blob/e93ee09b10f900bd3be385f392c80920898bf53e/contracts/ustb/UStb.sol#L191
Vulnerability details
Finding description and impact
UStb can be minted to non-whitelisted users 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 _mint() internal function. When the transferState is WHITELIST_ENABLED, it should only UStb to be minted to whitelisted users as mentioned under the main invariants in the README. But since the
to
address is not checked to have theWHITELISTED_ROLE
as well, the call goes through.A coded proof of concept is recommended for high severity findings.
Recommended mitigation steps
Add
hasRole(WHITELISTED_ROLE, to)
in the check.The text was updated successfully, but these errors were encountered: