Best Ceramic Yak
High
The missing onlyCoreContracts
modifier in the contractBurnFrom
method at USDa.sol:170
will allow any caller to burn tokens from accounts with sufficient allowances, as no checks ensure that the caller is a contract or a specific core contract. This could result in unauthorized token burns and potential token loss for users.
In USDa.sol:170
, the contractBurnFrom
method lacks the onlyCoreContracts
modifier. Without this, there is no validation to check if the caller is an authorized contract or even a smart contract (via isContract
).
- A user must approve a spender (possibly malicious) using the
contractApprove
function to allow burning tokens. - The approved spender has sufficient allowance to burn tokens on behalf of the user.
- The protocol does not enforce restrictions on which entity can call the
contractBurnFrom
function.
- An attacker calls
contractApprove
to set themselves as a spender for an account. - The attacker calls
contractBurnFrom
with the approved account as theowner
and specifies an amount within the approved allowance. - Tokens are burned from the owner’s account without additional checks or restrictions.
The protocol allows any caller to burn tokens from approved accounts, leading to potential token loss for users. An attacker could exploit this by:
- Burning tokens without authorization.
- Depleting the supply of tokens available to legitimate users.
No response
Add the onlyCoreContracts
modifier to the contractBurnFrom
function to restrict its usage to authorized core contracts only. Additionally, ensure that a check like isContract
verifies that the caller is a smart contract to avoid abuse from EOAs (Externally Owned Accounts).