mTBILL blacklisted users can successfully deposit in DepositVault despite not being able to receive mTBILL at all.
Summary
The blacklist feature in mTBILL token forbids a user to transfer or receive the token. However, the user is still free to deposit in the DepositVault, though he is not able to receive mTBILL.
Vulnerability Detail
The deposit workflow is user deposits stablecoin (e.g. USDC) to the DepositVault, and the M_TBILL_MINT_OPERATOR_ROLE role would mint mTBILL tokens to the user.
However, the deposit() function in DepositVault only checks if the msg.sender is greenlisted, but does not check if the user is blacklisted from mTBILL.
If a user is blacklisted from mTBILL, it would be not possible to mint mTBILL to the user, causing loss of funds.
pkqs90
medium
mTBILL
blacklisted users can successfully deposit inDepositVault
despite not being able to receive mTBILL at all.Summary
The blacklist feature in
mTBILL
token forbids a user to transfer or receive the token. However, the user is still free to deposit in theDepositVault
, though he is not able to receivemTBILL
.Vulnerability Detail
The deposit workflow is user deposits stablecoin (e.g. USDC) to the
DepositVault
, and theM_TBILL_MINT_OPERATOR_ROLE
role would mintmTBILL
tokens to the user.However, the
deposit()
function inDepositVault
only checks if themsg.sender
is greenlisted, but does not check if the user is blacklisted frommTBILL
.If a user is blacklisted from
mTBILL
, it would be not possible to mintmTBILL
to the user, causing loss of funds.https://github.com/sherlock-audit/2024-05-midas/blob/main/midas-contracts/contracts/DepositVault.sol#L91-L112
https://github.com/sherlock-audit/2024-05-midas/blob/main/midas-contracts/contracts/mTBILL.sol
Impact
User would lose funds if he is blacklisted from
mTBILL
but still tries to deposit inDepositVault
.Code Snippet
Tool used
Manual review
Recommendation
Also check if the user is blacklisted from
mTBILL
during the deposit phase.