Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burner admin can't rUSDY.burn tokens from any account #389

Closed
c4-submissions opened this issue Sep 7, 2023 · 7 comments
Closed

Burner admin can't rUSDY.burn tokens from any account #389

c4-submissions opened this issue Sep 7, 2023 · 7 comments
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-136 satisfactory satisfies C4 submission criteria; eligible for awards sufficient quality report This report is of sufficient quality

Comments

@c4-submissions
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L672

Vulnerability details

The natspec documentation for the rUSDY.burn function contains a statement that reads: Admin burn function for burning rUSDY tokens from any account, which is inaccurate.

Proof-of-Concept

This function is intended for use in situations where a user possesses USDY but is legally prohibited from owning it.
If a user is blocked, sanctioned, or not on the allowlist, then an account with the BURNER_ROLE will not be able to burn the user's tokens.

Include the following mock contract and test in the Test_rUSDY to examine it:

	contract BlockListMock {
  function isBlocked(address) external pure returns (bool) {
    return true;
  }
}

function test_rUSDY_adminCannotBurnFromBlocklistedAccount()
    public
    dealAndWrapAlice
  {
    vm.startPrank(guardian);
    BlockListMock blocklistContract = new BlockListMock();
    rUSDYToken.setBlocklist(address(blocklistContract));
    assertEq(address(rUSDYToken.blocklist()), address(blocklistContract));

    vm.expectRevert("rUSDY: 'sender' address blocked");
    rUSDYToken.burn(alice, 100e18);
  }

Impact

This does not align with the documentation, and the tokens that belonged to this user will be locked. However, any other users who are on the allowlist, not blocked, or sanctioned can have their tokens burned.

Tools Used

Manual

Recommended Mitigation Steps

Please contemplate the possibility of enabling the burning of tokens exclusively from blocked or sanctioned accounts.

Assessed type

Context

@c4-submissions c4-submissions added 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 labels Sep 7, 2023
c4-submissions added a commit that referenced this issue Sep 7, 2023
@c4-pre-sort
Copy link

raymondfam marked the issue as duplicate of #85

@c4-pre-sort
Copy link

raymondfam marked the issue as sufficient quality report

@c4-pre-sort c4-pre-sort added the sufficient quality report This report is of sufficient quality label Sep 8, 2023
@c4-judge
Copy link
Contributor

kirk-baird changed the severity to QA (Quality Assurance)

@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Sep 19, 2023
@c4-judge c4-judge reopened this Sep 26, 2023
@c4-judge c4-judge added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Sep 26, 2023
@c4-judge
Copy link
Contributor

This previously downgraded issue has been upgraded by kirk-baird

@c4-judge
Copy link
Contributor

kirk-baird marked the issue as not a duplicate

@c4-judge
Copy link
Contributor

kirk-baird marked the issue as duplicate of #136

@c4-judge c4-judge added duplicate-136 satisfactory satisfies C4 submission criteria; eligible for awards labels Sep 26, 2023
@c4-judge
Copy link
Contributor

kirk-baird marked the issue as satisfactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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-136 satisfactory satisfies C4 submission criteria; eligible for awards sufficient quality report This report is of sufficient quality
Projects
None yet
Development

No branches or pull requests

3 participants