Admin can't burn tokens of users who are not KYC'd #33
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
duplicate-32
edited-by-warden
🤖_26_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2024-03-ondo-finance/blob/main/contracts/ousg/rOUSG.sol#L597-L600
Vulnerability details
There is a
burn()
function which allows the admin to burn rOUSG tokens from any accouunt. The problem is that the admin can't burn tokens of users who are not KYC'd.Proof of Concept
Here is the implementation of the
burn()
function and_burnShares()
which is called by it:https://github.com/code-423n4/2024-03-ondo-finance/blob/main/contracts/ousg/rOUSG.sol#L618-L640
https://github.com/code-423n4/2024-03-ondo-finance/blob/main/contracts/ousg/rOUSG.sol#L554-L570
As we can see
_burnShares()
calls the internal_beforeTokenTransfer()
function which has the following check:This check prevents the admin from burning tokens from users who are not KYC'd
Impact
If the admin wants to burn the tokens of a user he has to add him back to the KYC list which would allow the user to send his tokens to another account thus preventing the burn from happening.
Recommended Mitigation Steps
Perhaps you can add a check to see if msg.sender is the admin and allow him to burn without KYC checks for the account whose tokens are being burned.
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: