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

Dangerous burn public #108

Closed
code423n4 opened this issue Mar 19, 2022 · 2 comments
Closed

Dangerous burn public #108

code423n4 opened this issue Mar 19, 2022 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/LongShortToken.sol#L8-L16

Vulnerability details

Impact

Users can burn Long/Short token accidentally

Proof of Concept

As LongShortToken.sol inherits from ERC20Burneable the function burn() is public. So users can call it accidentally and burn their tokens. It is much better override with a no operation to avoid this.

Tools Used

Manual code review

Recommended Mitigation Steps

Add this line to LongShortToken.sol (or something similar)

function burn(uint256 amount) public override {
    revert("disabled");
}
@code423n4 code423n4 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 Mar 19, 2022
code423n4 added a commit that referenced this issue Mar 19, 2022
@ramenforbreakfast
Copy link
Collaborator

I do not consider this valid. I don't see how a user would accidentally call a burn function.

@ramenforbreakfast ramenforbreakfast added duplicate This issue or pull request already exists sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue and removed duplicate This issue or pull request already exists labels Mar 24, 2022
@gzeoneth
Copy link
Member

gzeoneth commented Apr 3, 2022

Agree with sponsor, downgrading to Low/QA. Closing in favor of warden's QA report #106

@gzeoneth gzeoneth closed this as completed Apr 3, 2022
@gzeoneth gzeoneth added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax duplicate This issue or pull request already exists and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

3 participants