The admin wont be able to burn rOUSG from sanctioned addresses because of a check in _beforeTokenTransfer #147
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
🤖_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/78779c30bebfd46e6f416b03066c55d587e8b30b/contracts/ousg/rOUSG.sol#L632
Vulnerability details
The rOUSG.sol contracts has a burner role which is able to burn rOUSG from any address. The
burn()
function will be used to seize rOUSG/OUSG when the address is not legally allowed to own it. The problem is that the user will likely be sanctioned before the rOUSG is seized to freeze the funds but because the_burnShares()
function calls_beforeTokenTransfer()
, the tx will revert because of the check of the from address in_beforeTokenTransfer()
which will be the sanctioned address causing the check to revert.Although this finding was submitted in the previous contest a big difference here is that the KYCRegistry uses a Chainalysis sanction oracle for the checks in
_beforeTokenTransfer()
. In the previous contest this could have been bypassed by the admin batch executing transactions but because we are now using the Chainalysis oracle we will not be able to simply remove the sanctioned address from the oracle, burn the tokens and add it again.Impact
The admin wont be able to seize tokens from the sanctioned address because burning will always fail. The sanctioned address will be left with the tokens stuck in the wallet.
Proof of Concept
Add this to
rOUSG.t.sol
, as you can see burning from a sanctioned address will fail.Tools Used
Foundry
Recommended Mitigation Steps
Burn the tokens without the
_beforeTokenTransfer()
checkAssessed type
Token-Transfer
The text was updated successfully, but these errors were encountered: